Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
672378f0
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看板
提交
672378f0
编写于
1月 11, 2023
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:add logic for ins_columns
上级
19e72938
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
23 deletion
+20
-23
source/common/src/systable.c
source/common/src/systable.c
+1
-1
source/dnode/mnode/impl/src/mndShow.c
source/dnode/mnode/impl/src/mndShow.c
+3
-1
source/dnode/mnode/impl/src/mndStb.c
source/dnode/mnode/impl/src/mndStb.c
+7
-10
source/libs/executor/src/sysscanoperator.c
source/libs/executor/src/sysscanoperator.c
+9
-11
未找到文件。
source/common/src/systable.c
浏览文件 @
672378f0
...
...
@@ -178,8 +178,8 @@ static const SSysDbTableSchema userTagsSchema[] = {
static
const
SSysDbTableSchema
userColsSchema
[]
=
{
{.
name
=
"table_name"
,
.
bytes
=
SYSTABLE_SCH_TABLE_NAME_LEN
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
,
.
sysInfo
=
false
},
{.
name
=
"table_type"
,
.
bytes
=
21
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
,
.
sysInfo
=
false
},
{.
name
=
"db_name"
,
.
bytes
=
SYSTABLE_SCH_DB_NAME_LEN
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
,
.
sysInfo
=
false
},
{.
name
=
"table_type"
,
.
bytes
=
21
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
,
.
sysInfo
=
false
},
{.
name
=
"col_name"
,
.
bytes
=
TSDB_COL_NAME_LEN
-
1
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
,
.
sysInfo
=
false
},
{.
name
=
"col_type"
,
.
bytes
=
32
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
,
.
sysInfo
=
false
},
{.
name
=
"col_length"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
,
.
sysInfo
=
false
},
...
...
source/dnode/mnode/impl/src/mndShow.c
浏览文件 @
672378f0
...
...
@@ -193,13 +193,15 @@ static int32_t mndProcessRetrieveSysTableReq(SRpcMsg *pReq) {
int32_t
rowsToRead
=
SHOW_STEP_SIZE
;
int32_t
size
=
0
;
int32_t
rowsRead
=
0
;
mDebug
(
"mndProcessRetrieveSysTableReq start"
);
SRetrieveTableReq
retrieveReq
=
{
0
};
if
(
tDeserializeSRetrieveTableReq
(
pReq
->
pCont
,
pReq
->
contLen
,
&
retrieveReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
return
-
1
;
}
mDebug
(
"mndProcessRetrieveSysTableReq tb:%s"
,
retrieveReq
.
tb
);
if
(
retrieveReq
.
showId
==
0
)
{
STableMetaRsp
*
pMeta
=
taosHashGet
(
pMnode
->
infosMeta
,
retrieveReq
.
tb
,
strlen
(
retrieveReq
.
tb
));
if
(
pMeta
==
NULL
)
{
...
...
source/dnode/mnode/impl/src/mndStb.c
浏览文件 @
672378f0
...
...
@@ -2903,12 +2903,12 @@ static int32_t buildDbColsInfoBlock(const SSDataBlock* p, const SSysTableMeta* p
SColumnInfoData
*
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
0
);
colDataAppend
(
pColInfoData
,
numOfRows
,
tName
,
false
);
// database name
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
1
);
colDataAppend
(
pColInfoData
,
numOfRows
,
type
Name
,
false
);
colDataAppend
(
pColInfoData
,
numOfRows
,
d
Name
,
false
);
// database name
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
2
);
colDataAppend
(
pColInfoData
,
numOfRows
,
d
Name
,
false
);
colDataAppend
(
pColInfoData
,
numOfRows
,
type
Name
,
false
);
// col name
char
colName
[
TSDB_COL_NAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
...
...
@@ -2963,7 +2963,6 @@ static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
SMnode
*
pMnode
=
pReq
->
info
.
node
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
SStbObj
*
pStb
=
NULL
;
int32_t
cols
=
0
;
int32_t
numOfRows
=
buildSysDbColsInfo
(
pBlock
);
mDebug
(
"mndRetrieveStbCol get system table cols, rows:%d, db:%s"
,
numOfRows
,
pShow
->
db
);
...
...
@@ -2984,8 +2983,6 @@ static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
continue
;
}
cols
=
0
;
SName
name
=
{
0
};
char
stbName
[
TSDB_TABLE_NAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
mndExtractTbNameFromStbFullName
(
pStb
->
name
,
&
stbName
[
VARSTR_HEADER_SIZE
],
TSDB_TABLE_NAME_LEN
);
...
...
@@ -2999,14 +2996,15 @@ static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
varDataSetLen
(
db
,
strlen
(
varDataVal
(
db
)));
for
(
int
i
=
0
;
i
<
pStb
->
numOfColumns
;
i
++
){
int32_t
cols
=
0
;
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
stbName
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
typeName
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
db
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
db
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
typeName
,
false
);
// col name
char
colName
[
TSDB_COL_NAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
...
...
@@ -3036,10 +3034,9 @@ static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppendNULL
(
pColInfo
,
numOfRows
);
}
numOfRows
++
;
}
numOfRows
++
;
sdbRelease
(
pSdb
,
pStb
);
}
...
...
source/libs/executor/src/sysscanoperator.c
浏览文件 @
672378f0
...
...
@@ -67,7 +67,6 @@ typedef struct SSysTableScanInfo {
SLoadRemoteDataInfo
loadInfo
;
int32_t
tbnameSlotId
;
bool
isGetStableCols
;
}
SSysTableScanInfo
;
typedef
struct
{
...
...
@@ -921,12 +920,12 @@ static int32_t sysTableUserColsFillOneTableCols(const SSysTableScanInfo* pInfo,
pColInfoData
=
taosArrayGet
(
dataBlock
->
pDataBlock
,
0
);
colDataAppend
(
pColInfoData
,
numOfRows
,
tName
,
false
);
// database name
pColInfoData
=
taosArrayGet
(
dataBlock
->
pDataBlock
,
1
);
colDataAppend
(
pColInfoData
,
numOfRows
,
tableTyp
e
,
false
);
colDataAppend
(
pColInfoData
,
numOfRows
,
dbnam
e
,
false
);
// database name
pColInfoData
=
taosArrayGet
(
dataBlock
->
pDataBlock
,
2
);
colDataAppend
(
pColInfoData
,
numOfRows
,
dbnam
e
,
false
);
colDataAppend
(
pColInfoData
,
numOfRows
,
tableTyp
e
,
false
);
// col name
char
colName
[
TSDB_COL_NAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
...
...
@@ -1549,10 +1548,10 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator) {
char
dbName
[
TSDB_DB_NAME_LEN
]
=
{
0
};
const
char
*
name
=
tNameGetTableName
(
&
pInfo
->
name
);
if
(
pInfo
->
showRewrite
)
{
getDBNameFromCondition
(
pInfo
->
pCondition
,
dbName
);
sprintf
(
pInfo
->
req
.
db
,
"%d.%s"
,
pInfo
->
accountId
,
dbName
);
}
getDBNameFromCondition
(
pInfo
->
pCondition
,
dbName
);
strcpy
(
pInfo
->
req
.
db
,
dbName
);
//
sprintf(pInfo->req.db, "%d.%s", pInfo->accountId, dbName);
SSDataBlock
*
pBlock
=
NULL
;
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_TABLES
,
TSDB_TABLE_FNAME_LEN
)
==
0
)
{
pBlock
=
sysTableScanUserTables
(
pOperator
);
...
...
@@ -1630,7 +1629,7 @@ static SSDataBlock* sysTableScanFromMNode(SOperatorInfo* pOperator, SSysTableSca
tsem_wait
(
&
pInfo
->
ready
);
if
(
pTaskInfo
->
code
)
{
q
Debug
(
"%s load meta data from mnode failed, totalRows:%"
PRIu64
", code:%s"
,
GET_TASKID
(
pTaskInfo
),
q
Error
(
"%s load meta data from mnode failed, totalRows:%"
PRIu64
", code:%s"
,
GET_TASKID
(
pTaskInfo
),
pInfo
->
loadInfo
.
totalRows
,
tstrerror
(
pTaskInfo
->
code
));
return
NULL
;
}
...
...
@@ -1703,8 +1702,7 @@ SOperatorInfo* createSysTableScanOperatorInfo(void* readHandle, SSystemTableScan
const
char
*
name
=
tNameGetTableName
(
&
pInfo
->
name
);
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_TABLES
,
TSDB_TABLE_FNAME_LEN
)
==
0
||
strncasecmp
(
name
,
TSDB_INS_TABLE_TAGS
,
TSDB_TABLE_FNAME_LEN
)
==
0
||
strncasecmp
(
name
,
TSDB_INS_TABLE_COLS
,
TSDB_TABLE_FNAME_LEN
)
==
0
)
{
strncasecmp
(
name
,
TSDB_INS_TABLE_TAGS
,
TSDB_TABLE_FNAME_LEN
)
==
0
)
{
pInfo
->
readHandle
=
*
(
SReadHandle
*
)
readHandle
;
}
else
{
tsem_init
(
&
pInfo
->
ready
,
0
,
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录