Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6f7add88
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1181
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6f7add88
编写于
5月 15, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: do some internal refactor.
上级
6cbedc5d
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
31 addition
and
31 deletion
+31
-31
source/dnode/mnode/impl/src/mndStb.c
source/dnode/mnode/impl/src/mndStb.c
+23
-23
source/dnode/vnode/src/tq/tqRead.c
source/dnode/vnode/src/tq/tqRead.c
+8
-8
未找到文件。
source/dnode/mnode/impl/src/mndStb.c
浏览文件 @
6f7add88
...
...
@@ -2742,7 +2742,7 @@ void mndExtractTbNameFromStbFullName(const char *stbFullName, char *dst, int32_t
// varDataSetLen(stbName, strlen(&stbName[VARSTR_HEADER_SIZE]));
//
// SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
// colData
Append
(pColInfo, numOfRows, (const char *)stbName, false);
// colData
SetVal
(pColInfo, numOfRows, (const char *)stbName, false);
//
// char db[TSDB_DB_NAME_LEN + VARSTR_HEADER_SIZE] = {0};
// tNameFromString(&name, pStb->db, T_NAME_ACCT | T_NAME_DB);
...
...
@@ -2750,29 +2750,29 @@ void mndExtractTbNameFromStbFullName(const char *stbFullName, char *dst, int32_t
// varDataSetLen(db, strlen(varDataVal(db)));
//
// pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
// colData
Append
(pColInfo, numOfRows, (const char *)db, false);
// colData
SetVal
(pColInfo, numOfRows, (const char *)db, false);
//
// pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
// colData
Append
(pColInfo, numOfRows, (const char *)&pStb->createdTime, false);
// colData
SetVal
(pColInfo, numOfRows, (const char *)&pStb->createdTime, false);
//
// pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
// colData
Append
(pColInfo, numOfRows, (const char *)&pStb->numOfColumns, false);
// colData
SetVal
(pColInfo, numOfRows, (const char *)&pStb->numOfColumns, false);
//
// pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
// colData
Append
(pColInfo, numOfRows, (const char *)&pStb->numOfTags, false);
// colData
SetVal
(pColInfo, numOfRows, (const char *)&pStb->numOfTags, false);
//
// pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
// colData
Append
(pColInfo, numOfRows, (const char *)&pStb->updateTime, false); // number of tables
// colData
SetVal
(pColInfo, numOfRows, (const char *)&pStb->updateTime, false); // number of tables
//
// pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
// if (pStb->commentLen > 0) {
// char comment[TSDB_TB_COMMENT_LEN + VARSTR_HEADER_SIZE] = {0};
// STR_TO_VARSTR(comment, pStb->comment);
// colData
Append
(pColInfo, numOfRows, comment, false);
// colData
SetVal
(pColInfo, numOfRows, comment, false);
// } else if (pStb->commentLen == 0) {
// char comment[VARSTR_HEADER_SIZE + VARSTR_HEADER_SIZE] = {0};
// STR_TO_VARSTR(comment, "");
// colData
Append
(pColInfo, numOfRows, comment, false);
// colData
SetVal
(pColInfo, numOfRows, comment, false);
// } else {
// colDataSetNULL(pColInfo, numOfRows);
// }
...
...
@@ -2782,14 +2782,14 @@ void mndExtractTbNameFromStbFullName(const char *stbFullName, char *dst, int32_t
// varDataSetLen(watermark, strlen(varDataVal(watermark)));
//
// pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
// colData
Append
(pColInfo, numOfRows, (const char *)watermark, false);
// colData
SetVal
(pColInfo, numOfRows, (const char *)watermark, false);
//
// char maxDelay[64 + VARSTR_HEADER_SIZE] = {0};
// sprintf(varDataVal(maxDelay), "%" PRId64 "a,%" PRId64 "a", pStb->maxdelay[0], pStb->maxdelay[1]);
// varDataSetLen(maxDelay, strlen(varDataVal(maxDelay)));
//
// pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
// colData
Append
(pColInfo, numOfRows, (const char *)maxDelay, false);
// colData
SetVal
(pColInfo, numOfRows, (const char *)maxDelay, false);
//
// char rollup[160 + VARSTR_HEADER_SIZE] = {0};
// int32_t rollupNum = (int32_t)taosArrayGetSize(pStb->pFuncs);
...
...
@@ -2808,7 +2808,7 @@ void mndExtractTbNameFromStbFullName(const char *stbFullName, char *dst, int32_t
// varDataSetLen(rollup, strlen(varDataVal(rollup)));
//
// pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
// colData
Append
(pColInfo, numOfRows, (const char *)rollup, false);
// colData
SetVal
(pColInfo, numOfRows, (const char *)rollup, false);
//
// numOfRows++;
// sdbRelease(pSdb, pStb);
...
...
@@ -3067,20 +3067,20 @@ static int32_t buildDbColsInfoBlock(const SSDataBlock *p, const SSysTableMeta *p
for
(
int32_t
j
=
0
;
j
<
pm
->
colNum
;
j
++
)
{
// table name
SColumnInfoData
*
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
0
);
colData
Append
(
pColInfoData
,
numOfRows
,
tName
,
false
);
colData
SetVal
(
pColInfoData
,
numOfRows
,
tName
,
false
);
// database name
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
1
);
colData
Append
(
pColInfoData
,
numOfRows
,
dName
,
false
);
colData
SetVal
(
pColInfoData
,
numOfRows
,
dName
,
false
);
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
2
);
colData
Append
(
pColInfoData
,
numOfRows
,
typeName
,
false
);
colData
SetVal
(
pColInfoData
,
numOfRows
,
typeName
,
false
);
// col name
char
colName
[
TSDB_COL_NAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_TO_VARSTR
(
colName
,
pm
->
schema
[
j
].
name
);
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
3
);
colData
Append
(
pColInfoData
,
numOfRows
,
colName
,
false
);
colData
SetVal
(
pColInfoData
,
numOfRows
,
colName
,
false
);
// col type
int8_t
colType
=
pm
->
schema
[
j
].
type
;
...
...
@@ -3095,10 +3095,10 @@ static int32_t buildDbColsInfoBlock(const SSDataBlock *p, const SSysTableMeta *p
(
int32_t
)((
pm
->
schema
[
j
].
bytes
-
VARSTR_HEADER_SIZE
)
/
TSDB_NCHAR_SIZE
));
}
varDataSetLen
(
colTypeStr
,
colTypeLen
);
colData
Append
(
pColInfoData
,
numOfRows
,
(
char
*
)
colTypeStr
,
false
);
colData
SetVal
(
pColInfoData
,
numOfRows
,
(
char
*
)
colTypeStr
,
false
);
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
5
);
colData
Append
(
pColInfoData
,
numOfRows
,
(
const
char
*
)
&
pm
->
schema
[
j
].
bytes
,
false
);
colData
SetVal
(
pColInfoData
,
numOfRows
,
(
const
char
*
)
&
pm
->
schema
[
j
].
bytes
,
false
);
for
(
int32_t
k
=
6
;
k
<=
8
;
++
k
)
{
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
k
);
colDataSetNULL
(
pColInfoData
,
numOfRows
);
...
...
@@ -3192,19 +3192,19 @@ static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
for
(
int
i
=
0
;
i
<
pStb
->
numOfColumns
;
i
++
)
{
int32_t
cols
=
0
;
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colData
Append
(
pColInfo
,
numOfRows
,
(
const
char
*
)
stbName
,
false
);
colData
SetVal
(
pColInfo
,
numOfRows
,
(
const
char
*
)
stbName
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colData
Append
(
pColInfo
,
numOfRows
,
(
const
char
*
)
db
,
false
);
colData
SetVal
(
pColInfo
,
numOfRows
,
(
const
char
*
)
db
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colData
Append
(
pColInfo
,
numOfRows
,
typeName
,
false
);
colData
SetVal
(
pColInfo
,
numOfRows
,
typeName
,
false
);
// col name
char
colName
[
TSDB_COL_NAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_TO_VARSTR
(
colName
,
pStb
->
pColumns
[
i
].
name
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colData
Append
(
pColInfo
,
numOfRows
,
colName
,
false
);
colData
SetVal
(
pColInfo
,
numOfRows
,
colName
,
false
);
// col type
int8_t
colType
=
pStb
->
pColumns
[
i
].
type
;
...
...
@@ -3219,10 +3219,10 @@ static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
(
int32_t
)((
pStb
->
pColumns
[
i
].
bytes
-
VARSTR_HEADER_SIZE
)
/
TSDB_NCHAR_SIZE
));
}
varDataSetLen
(
colTypeStr
,
colTypeLen
);
colData
Append
(
pColInfo
,
numOfRows
,
(
char
*
)
colTypeStr
,
false
);
colData
SetVal
(
pColInfo
,
numOfRows
,
(
char
*
)
colTypeStr
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colData
Append
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pStb
->
pColumns
[
i
].
bytes
,
false
);
colData
SetVal
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pStb
->
pColumns
[
i
].
bytes
,
false
);
while
(
cols
<
pShow
->
numOfColumns
)
{
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataSetNULL
(
pColInfo
,
numOfRows
);
...
...
source/dnode/vnode/src/tq/tqRead.c
浏览文件 @
6f7add88
...
...
@@ -645,14 +645,14 @@ int32_t tqRetrieveDataBlock(STqReader* pReader, SSubmitTbData** pSubmitTbDataRet
char
val
[
65535
+
2
]
=
{
0
};
memcpy
(
varDataVal
(
val
),
colVal
.
value
.
pData
,
colVal
.
value
.
nData
);
varDataSetLen
(
val
,
colVal
.
value
.
nData
);
if
(
colData
Append
(
pColData
,
i
,
val
,
!
COL_VAL_IS_VALUE
(
&
colVal
))
<
0
)
{
if
(
colData
SetVal
(
pColData
,
i
,
val
,
!
COL_VAL_IS_VALUE
(
&
colVal
))
<
0
)
{
return
-
1
;
}
}
else
{
colDataSetNULL
(
pColData
,
i
);
}
}
else
{
if
(
colData
Append
(
pColData
,
i
,
(
void
*
)
&
colVal
.
value
.
val
,
!
COL_VAL_IS_VALUE
(
&
colVal
))
<
0
)
{
if
(
colData
SetVal
(
pColData
,
i
,
(
void
*
)
&
colVal
.
value
.
val
,
!
COL_VAL_IS_VALUE
(
&
colVal
))
<
0
)
{
return
-
1
;
}
}
...
...
@@ -694,14 +694,14 @@ int32_t tqRetrieveDataBlock(STqReader* pReader, SSubmitTbData** pSubmitTbDataRet
char
val
[
65535
+
2
]
=
{
0
};
memcpy
(
varDataVal
(
val
),
colVal
.
value
.
pData
,
colVal
.
value
.
nData
);
varDataSetLen
(
val
,
colVal
.
value
.
nData
);
if
(
colData
Append
(
pColData
,
i
,
val
,
!
COL_VAL_IS_VALUE
(
&
colVal
))
<
0
)
{
if
(
colData
SetVal
(
pColData
,
i
,
val
,
!
COL_VAL_IS_VALUE
(
&
colVal
))
<
0
)
{
return
-
1
;
}
}
else
{
colDataSetNULL
(
pColData
,
i
);
}
}
else
{
if
(
colData
Append
(
pColData
,
i
,
(
void
*
)
&
colVal
.
value
.
val
,
!
COL_VAL_IS_VALUE
(
&
colVal
))
<
0
)
{
if
(
colData
SetVal
(
pColData
,
i
,
(
void
*
)
&
colVal
.
value
.
val
,
!
COL_VAL_IS_VALUE
(
&
colVal
))
<
0
)
{
return
-
1
;
}
}
...
...
@@ -841,14 +841,14 @@ int32_t tqRetrieveTaosxBlock(STqReader* pReader, SArray* blocks, SArray* schemas
char
val
[
65535
+
2
];
memcpy
(
varDataVal
(
val
),
colVal
.
value
.
pData
,
colVal
.
value
.
nData
);
varDataSetLen
(
val
,
colVal
.
value
.
nData
);
if
(
colData
Append
(
pColData
,
curRow
-
lastRow
,
val
,
!
COL_VAL_IS_VALUE
(
&
colVal
))
<
0
)
{
if
(
colData
SetVal
(
pColData
,
curRow
-
lastRow
,
val
,
!
COL_VAL_IS_VALUE
(
&
colVal
))
<
0
)
{
goto
FAIL
;
}
}
else
{
colDataSetNULL
(
pColData
,
curRow
-
lastRow
);
}
}
else
{
if
(
colData
Append
(
pColData
,
curRow
-
lastRow
,
(
void
*
)
&
colVal
.
value
.
val
,
!
COL_VAL_IS_VALUE
(
&
colVal
))
<
0
)
{
if
(
colData
SetVal
(
pColData
,
curRow
-
lastRow
,
(
void
*
)
&
colVal
.
value
.
val
,
!
COL_VAL_IS_VALUE
(
&
colVal
))
<
0
)
{
goto
FAIL
;
}
}
...
...
@@ -938,14 +938,14 @@ int32_t tqRetrieveTaosxBlock(STqReader* pReader, SArray* blocks, SArray* schemas
char
val
[
65535
+
2
];
memcpy
(
varDataVal
(
val
),
colVal
.
value
.
pData
,
colVal
.
value
.
nData
);
varDataSetLen
(
val
,
colVal
.
value
.
nData
);
if
(
colData
Append
(
pColData
,
curRow
-
lastRow
,
val
,
!
COL_VAL_IS_VALUE
(
&
colVal
))
<
0
)
{
if
(
colData
SetVal
(
pColData
,
curRow
-
lastRow
,
val
,
!
COL_VAL_IS_VALUE
(
&
colVal
))
<
0
)
{
goto
FAIL
;
}
}
else
{
colDataSetNULL
(
pColData
,
curRow
-
lastRow
);
}
}
else
{
if
(
colData
Append
(
pColData
,
curRow
-
lastRow
,
(
void
*
)
&
colVal
.
value
.
val
,
!
COL_VAL_IS_VALUE
(
&
colVal
))
<
0
)
{
if
(
colData
SetVal
(
pColData
,
curRow
-
lastRow
,
(
void
*
)
&
colVal
.
value
.
val
,
!
COL_VAL_IS_VALUE
(
&
colVal
))
<
0
)
{
goto
FAIL
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录