Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f612eafe
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看板
提交
f612eafe
编写于
10月 20, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
opt sys query
上级
54c7d6cb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
192 addition
and
148 deletion
+192
-148
source/dnode/vnode/src/meta/metaQuery.c
source/dnode/vnode/src/meta/metaQuery.c
+34
-0
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+158
-148
未找到文件。
source/dnode/vnode/src/meta/metaQuery.c
浏览文件 @
f612eafe
...
...
@@ -1106,8 +1106,41 @@ int32_t metaFilterTableName(SMeta *pMeta, SMetaFltParam *param, SArray *pUids) {
pCursor
->
cid
=
param
->
cid
;
pCursor
->
type
=
param
->
type
;
char
*
pName
=
param
->
val
;
metaRLock
(
pMeta
);
ret
=
tdbTbcOpen
(
pMeta
->
pNameIdx
,
&
pCursor
->
pCur
,
NULL
);
if
(
ret
!=
0
)
{
goto
END
;
}
int
cmp
=
0
;
if
(
tdbTbcMoveTo
(
pCursor
->
pCur
,
pName
,
strlen
(
pName
)
+
1
,
&
cmp
)
<
0
)
{
goto
END
;
}
bool
first
=
true
;
int32_t
valid
=
0
;
while
(
1
)
{
void
*
pEntryKey
=
NULL
,
*
pEntryVal
=
NULL
;
int32_t
nEntryKey
=
-
1
,
nEntryVal
=
0
;
valid
=
tdbTbcGet
(
pCursor
->
pCur
,
(
const
void
**
)
pEntryKey
,
&
nEntryKey
,
(
const
void
**
)
&
pEntryVal
,
&
nEntryVal
);
if
(
valid
<
0
)
break
;
char
*
pTableKey
=
(
char
*
)
pEntryKey
;
int32_t
cmp
=
(
*
param
->
filterFunc
)(
pTableKey
,
pName
,
pCursor
->
type
);
if
(
cmp
==
0
)
{
tb_uid_t
tuid
=
*
(
tb_uid_t
*
)
pEntryVal
;
taosArrayPush
(
pUids
,
&
tuid
);
}
else
if
(
cmp
==
1
)
{
// next
}
else
{
break
;
}
valid
=
param
->
reverse
?
tdbTbcMoveToPrev
(
pCursor
->
pCur
)
:
tdbTbcMoveToNext
(
pCursor
->
pCur
);
if
(
valid
<
0
)
{
break
;
}
}
END:
if
(
pCursor
->
pMeta
)
metaULock
(
pCursor
->
pMeta
);
...
...
@@ -1215,6 +1248,7 @@ int32_t metaFilterTableIds(SMeta *pMeta, SMetaFltParam *param, SArray *pUids) {
valid
=
tdbTbcGet
(
pCursor
->
pCur
,
(
const
void
**
)
&
entryKey
,
&
nEntryKey
,
(
const
void
**
)
&
entryVal
,
&
nEntryVal
);
if
(
valid
<
0
)
{
tdbFree
(
entryVal
);
break
;
}
STagIdxKey
*
p
=
entryKey
;
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
f612eafe
...
...
@@ -3213,176 +3213,144 @@ static int32_t optSysTabFilte(void* arg, SNode* cond, SArray* result) {
return
hasIdx
==
true
?
0
:
-
1
;
}
static
SSDataBlock
*
sysTable
Scan
UserTables
(
SOperatorInfo
*
pOperator
)
{
static
SSDataBlock
*
sysTable
Build
UserTables
(
SOperatorInfo
*
pOperator
)
{
SExecTaskInfo
*
pTaskInfo
=
pOperator
->
pTaskInfo
;
SSysTableScanInfo
*
pInfo
=
pOperator
->
info
;
SNode
*
pCondtion
=
pInfo
->
pCondition
;
if
(
pOperator
->
status
==
OP_EXEC_DONE
)
{
return
NULL
;
if
(
pInfo
->
pCur
==
NULL
)
{
pInfo
->
pCur
=
metaOpenTbCursor
(
pInfo
->
readHandle
.
meta
);
}
// the retrieve is executed on the mnode, so return tables that belongs to the information schema database.
if
(
pInfo
->
readHandle
.
mnd
!=
NULL
)
{
buildSysDbTableInfo
(
pInfo
,
pOperator
->
resultInfo
.
capacity
);
doFilterResult
(
pInfo
);
pInfo
->
loadInfo
.
totalRows
+=
pInfo
->
pRes
->
info
.
rows
;
doSetOperatorCompleted
(
pOperator
);
return
(
pInfo
->
pRes
->
info
.
rows
==
0
)
?
NULL
:
pInfo
->
pRes
;
}
else
{
if
(
pInfo
->
pCur
==
NULL
)
{
pInfo
->
pCur
=
metaOpenTbCursor
(
pInfo
->
readHandle
.
meta
);
}
blockDataCleanup
(
pInfo
->
pRes
);
int32_t
numOfRows
=
0
;
const
char
*
db
=
NULL
;
int32_t
vgId
=
0
;
vnodeGetInfo
(
pInfo
->
readHandle
.
vnode
,
&
db
,
&
vgId
);
blockDataCleanup
(
pInfo
->
pRes
);
int32_t
numOfRows
=
0
;
SName
sn
=
{
0
}
;
char
dbname
[
TSDB_DB_FNAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
}
;
tNameFromString
(
&
sn
,
db
,
T_NAME_ACCT
|
T_NAME_DB
);
const
char
*
db
=
NULL
;
int32_t
vgId
=
0
;
vnodeGetInfo
(
pInfo
->
readHandle
.
vnode
,
&
db
,
&
vgId
);
tNameGetDbName
(
&
sn
,
varDataVal
(
dbname
));
varDataSetLen
(
dbname
,
strlen
(
varDataVal
(
dbname
)));
SName
sn
=
{
0
};
char
dbname
[
TSDB_DB_FNAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
tNameFromString
(
&
sn
,
db
,
T_NAME_ACCT
|
T_NAME_DB
);
SSDataBlock
*
p
=
buildInfoSchemaTableMetaBlock
(
TSDB_INS_TABLE_TABLES
);
blockDataEnsureCapacity
(
p
,
pOperator
->
resultInfo
.
capacity
);
tNameGetDbName
(
&
sn
,
varDataVal
(
dbname
)
);
varDataSetLen
(
dbname
,
strlen
(
varDataVal
(
dbname
))
);
char
n
[
TSDB_TABLE_NAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
SSDataBlock
*
p
=
buildInfoSchemaTableMetaBlock
(
TSDB_INS_TABLE_TABLES
);
blockDataEnsureCapacity
(
p
,
pOperator
->
resultInfo
.
capacity
);
int32_t
ret
=
0
;
while
((
ret
=
metaTbCursorNext
(
pInfo
->
pCur
))
==
0
)
{
STR_TO_VARSTR
(
n
,
pInfo
->
pCur
->
mr
.
me
.
name
);
char
n
[
TSDB_TABLE_NAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
// table name
SColumnInfoData
*
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
0
);
colDataAppend
(
pColInfoData
,
numOfRows
,
n
,
fals
e
);
int32_t
ret
=
0
;
while
((
ret
=
metaTbCursorNext
(
pInfo
->
pCur
))
==
0
)
{
STR_TO_VARSTR
(
n
,
pInfo
->
pCur
->
mr
.
me
.
nam
e
);
// database name
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
1
);
colDataAppend
(
pColInfoData
,
numOfRows
,
dbname
,
false
);
// vgId
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
6
);
colDataAppend
(
pColInfoData
,
numOfRows
,
(
char
*
)
&
vgId
,
false
);
int32_t
tableType
=
pInfo
->
pCur
->
mr
.
me
.
type
;
if
(
tableType
==
TSDB_CHILD_TABLE
)
{
// create time
int64_t
ts
=
pInfo
->
pCur
->
mr
.
me
.
ctbEntry
.
ctime
;
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
2
);
colDataAppend
(
pColInfoData
,
numOfRows
,
(
char
*
)
&
ts
,
false
);
SMetaReader
mr
=
{
0
};
metaReaderInit
(
&
mr
,
pInfo
->
readHandle
.
meta
,
META_READER_NOLOCK
);
uint64_t
suid
=
pInfo
->
pCur
->
mr
.
me
.
ctbEntry
.
suid
;
int32_t
code
=
metaGetTableEntryByUid
(
&
mr
,
suid
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
qError
(
"failed to get super table meta, cname:%s, suid:0x%"
PRIx64
", code:%s, %s"
,
pInfo
->
pCur
->
mr
.
me
.
name
,
suid
,
tstrerror
(
terrno
),
GET_TASKID
(
pTaskInfo
));
metaReaderClear
(
&
mr
);
metaCloseTbCursor
(
pInfo
->
pCur
);
pInfo
->
pCur
=
NULL
;
T_LONG_JMP
(
pTaskInfo
->
env
,
terrno
);
}
// table name
SColumnInfoData
*
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
0
);
colDataAppend
(
pColInfoData
,
numOfRows
,
n
,
false
);
// number of columns
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
3
);
colDataAppend
(
pColInfoData
,
numOfRows
,
(
char
*
)
&
mr
.
me
.
stbEntry
.
schemaRow
.
nCols
,
false
);
// database name
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
1
);
colDataAppend
(
pColInfoData
,
numOfRows
,
dbname
,
false
);
// super table name
STR_TO_VARSTR
(
n
,
mr
.
me
.
name
);
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
4
);
colDataAppend
(
pColInfoData
,
numOfRows
,
n
,
false
);
// vgId
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
6
);
colDataAppend
(
pColInfoData
,
numOfRows
,
(
char
*
)
&
vgId
,
false
);
int32_t
tableType
=
pInfo
->
pCur
->
mr
.
me
.
type
;
if
(
tableType
==
TSDB_CHILD_TABLE
)
{
// create time
int64_t
ts
=
pInfo
->
pCur
->
mr
.
me
.
ctbEntry
.
ctime
;
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
2
);
colDataAppend
(
pColInfoData
,
numOfRows
,
(
char
*
)
&
ts
,
false
);
SMetaReader
mr
=
{
0
};
metaReaderInit
(
&
mr
,
pInfo
->
readHandle
.
meta
,
META_READER_NOLOCK
);
uint64_t
suid
=
pInfo
->
pCur
->
mr
.
me
.
ctbEntry
.
suid
;
int32_t
code
=
metaGetTableEntryByUid
(
&
mr
,
suid
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
qError
(
"failed to get super table meta, cname:%s, suid:0x%"
PRIx64
", code:%s, %s"
,
pInfo
->
pCur
->
mr
.
me
.
name
,
suid
,
tstrerror
(
terrno
),
GET_TASKID
(
pTaskInfo
));
metaReaderClear
(
&
mr
);
metaCloseTbCursor
(
pInfo
->
pCur
);
pInfo
->
pCur
=
NULL
;
T_LONG_JMP
(
pTaskInfo
->
env
,
terrno
);
}
// table comment
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
8
);
if
(
pInfo
->
pCur
->
mr
.
me
.
ctbEntry
.
commentLen
>
0
)
{
char
comment
[
TSDB_TB_COMMENT_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_TO_VARSTR
(
comment
,
pInfo
->
pCur
->
mr
.
me
.
ctbEntry
.
comment
);
colDataAppend
(
pColInfoData
,
numOfRows
,
comment
,
false
);
}
else
if
(
pInfo
->
pCur
->
mr
.
me
.
ctbEntry
.
commentLen
==
0
)
{
char
comment
[
VARSTR_HEADER_SIZE
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_TO_VARSTR
(
comment
,
""
);
colDataAppend
(
pColInfoData
,
numOfRows
,
comment
,
false
);
}
else
{
colDataAppendNULL
(
pColInfoData
,
numOfRows
);
}
// uid
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
5
);
colDataAppend
(
pColInfoData
,
numOfRows
,
(
char
*
)
&
pInfo
->
pCur
->
mr
.
me
.
uid
,
false
);
// ttl
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
7
);
colDataAppend
(
pColInfoData
,
numOfRows
,
(
char
*
)
&
pInfo
->
pCur
->
mr
.
me
.
ctbEntry
.
ttlDays
,
false
);
STR_TO_VARSTR
(
n
,
"CHILD_TABLE"
);
}
else
if
(
tableType
==
TSDB_NORMAL_TABLE
)
{
// create time
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
2
);
colDataAppend
(
pColInfoData
,
numOfRows
,
(
char
*
)
&
pInfo
->
pCur
->
mr
.
me
.
ntbEntry
.
ctime
,
false
);
// number of columns
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
3
);
colDataAppend
(
pColInfoData
,
numOfRows
,
(
char
*
)
&
mr
.
me
.
stbEntry
.
schemaRow
.
nCols
,
false
);
// number of columns
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
3
);
colDataAppend
(
pColInfoData
,
numOfRows
,
(
char
*
)
&
pInfo
->
pCur
->
mr
.
me
.
ntbEntry
.
schemaRow
.
nCols
,
false
);
// super table name
STR_TO_VARSTR
(
n
,
mr
.
me
.
name
);
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
4
);
colDataAppend
(
pColInfoData
,
numOfRows
,
n
,
false
);
metaReaderClear
(
&
mr
);
// super table name
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
4
);
// table comment
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
8
);
if
(
pInfo
->
pCur
->
mr
.
me
.
ctbEntry
.
commentLen
>
0
)
{
char
comment
[
TSDB_TB_COMMENT_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_TO_VARSTR
(
comment
,
pInfo
->
pCur
->
mr
.
me
.
ctbEntry
.
comment
);
colDataAppend
(
pColInfoData
,
numOfRows
,
comment
,
false
);
}
else
if
(
pInfo
->
pCur
->
mr
.
me
.
ctbEntry
.
commentLen
==
0
)
{
char
comment
[
VARSTR_HEADER_SIZE
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_TO_VARSTR
(
comment
,
""
);
colDataAppend
(
pColInfoData
,
numOfRows
,
comment
,
false
);
}
else
{
colDataAppendNULL
(
pColInfoData
,
numOfRows
);
}
// table comment
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
8
);
if
(
pInfo
->
pCur
->
mr
.
me
.
ntbEntry
.
commentLen
>
0
)
{
char
comment
[
TSDB_TB_COMMENT_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_TO_VARSTR
(
comment
,
pInfo
->
pCur
->
mr
.
me
.
ntbEntry
.
comment
);
colDataAppend
(
pColInfoData
,
numOfRows
,
comment
,
false
);
}
else
if
(
pInfo
->
pCur
->
mr
.
me
.
ntbEntry
.
commentLen
==
0
)
{
char
comment
[
VARSTR_HEADER_SIZE
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_TO_VARSTR
(
comment
,
""
);
colDataAppend
(
pColInfoData
,
numOfRows
,
comment
,
false
);
}
else
{
colDataAppendNULL
(
pColInfoData
,
numOfRows
);
}
// uid
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
5
);
colDataAppend
(
pColInfoData
,
numOfRows
,
(
char
*
)
&
pInfo
->
pCur
->
mr
.
me
.
uid
,
false
);
// uid
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
5
);
colDataAppend
(
pColInfoData
,
numOfRows
,
(
char
*
)
&
pInfo
->
pCur
->
mr
.
me
.
uid
,
false
);
// ttl
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
7
);
colDataAppend
(
pColInfoData
,
numOfRows
,
(
char
*
)
&
pInfo
->
pCur
->
mr
.
me
.
ctbEntry
.
ttlDays
,
false
);
// ttl
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
7
);
colDataAppend
(
pColInfoData
,
numOfRows
,
(
char
*
)
&
pInfo
->
pCur
->
mr
.
me
.
ntbEntry
.
ttlDays
,
false
);
STR_TO_VARSTR
(
n
,
"CHILD_TABLE"
);
}
else
if
(
tableType
==
TSDB_NORMAL_TABLE
)
{
// create time
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
2
);
colDataAppend
(
pColInfoData
,
numOfRows
,
(
char
*
)
&
pInfo
->
pCur
->
mr
.
me
.
ntbEntry
.
ctime
,
false
);
STR_TO_VARSTR
(
n
,
"NORMAL_TABLE"
);
}
// number of columns
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
3
);
colDataAppend
(
pColInfoData
,
numOfRows
,
(
char
*
)
&
pInfo
->
pCur
->
mr
.
me
.
ntbEntry
.
schemaRow
.
nCols
,
false
);
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
9
);
colDataAppend
(
pColInfoData
,
numOfRows
,
n
,
false
);
// super table name
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
4
);
colDataAppendNULL
(
pColInfoData
,
numOfRows
);
if
(
++
numOfRows
>=
pOperator
->
resultInfo
.
capacity
)
{
p
->
info
.
rows
=
numOfRows
;
pInfo
->
pRes
->
info
.
rows
=
numOfRows
;
// table comment
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
8
);
if
(
pInfo
->
pCur
->
mr
.
me
.
ntbEntry
.
commentLen
>
0
)
{
char
comment
[
TSDB_TB_COMMENT_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_TO_VARSTR
(
comment
,
pInfo
->
pCur
->
mr
.
me
.
ntbEntry
.
comment
);
colDataAppend
(
pColInfoData
,
numOfRows
,
comment
,
false
);
}
else
if
(
pInfo
->
pCur
->
mr
.
me
.
ntbEntry
.
commentLen
==
0
)
{
char
comment
[
VARSTR_HEADER_SIZE
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_TO_VARSTR
(
comment
,
""
);
colDataAppend
(
pColInfoData
,
numOfRows
,
comment
,
false
);
}
else
{
colDataAppendNULL
(
pColInfoData
,
numOfRows
);
}
relocateColumnData
(
pInfo
->
pRes
,
pInfo
->
scanCols
,
p
->
pDataBlock
,
false
);
doFilterResult
(
pInfo
);
// uid
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
5
);
colDataAppend
(
pColInfoData
,
numOfRows
,
(
char
*
)
&
pInfo
->
pCur
->
mr
.
me
.
uid
,
false
);
blockDataCleanup
(
p
);
numOfRows
=
0
;
// ttl
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
7
);
colDataAppend
(
pColInfoData
,
numOfRows
,
(
char
*
)
&
pInfo
->
pCur
->
mr
.
me
.
ntbEntry
.
ttlDays
,
false
);
if
(
pInfo
->
pRes
->
info
.
rows
>
0
)
{
break
;
}
}
STR_TO_VARSTR
(
n
,
"NORMAL_TABLE"
);
}
if
(
numOfRows
>
0
)
{
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
9
);
colDataAppend
(
pColInfoData
,
numOfRows
,
n
,
false
);
if
(
++
numOfRows
>=
pOperator
->
resultInfo
.
capacity
)
{
p
->
info
.
rows
=
numOfRows
;
pInfo
->
pRes
->
info
.
rows
=
numOfRows
;
...
...
@@ -3391,20 +3359,62 @@ static SSDataBlock* sysTableScanUserTables(SOperatorInfo* pOperator) {
blockDataCleanup
(
p
);
numOfRows
=
0
;
if
(
pInfo
->
pRes
->
info
.
rows
>
0
)
{
break
;
}
}
}
blockDataDestroy
(
p
);
if
(
numOfRows
>
0
)
{
p
->
info
.
rows
=
numOfRows
;
pInfo
->
pRes
->
info
.
rows
=
numOfRows
;
// todo temporarily free the cursor here, the true reason why the free is not valid needs to be found
if
(
ret
!=
0
)
{
metaCloseTbCursor
(
pInfo
->
pCur
);
pInfo
->
pCur
=
NULL
;
doSetOperatorCompleted
(
pOperator
);
}
relocateColumnData
(
pInfo
->
pRes
,
pInfo
->
scanCols
,
p
->
pDataBlock
,
false
);
doFilterResult
(
pInfo
);
blockDataCleanup
(
p
);
numOfRows
=
0
;
}
blockDataDestroy
(
p
);
// todo temporarily free the cursor here, the true reason why the free is not valid needs to be found
if
(
ret
!=
0
)
{
metaCloseTbCursor
(
pInfo
->
pCur
);
pInfo
->
pCur
=
NULL
;
doSetOperatorCompleted
(
pOperator
);
}
pInfo
->
loadInfo
.
totalRows
+=
pInfo
->
pRes
->
info
.
rows
;
return
(
pInfo
->
pRes
->
info
.
rows
==
0
)
?
NULL
:
pInfo
->
pRes
;
}
static
SSDataBlock
*
sysTableScanUserTables
(
SOperatorInfo
*
pOperator
)
{
SExecTaskInfo
*
pTaskInfo
=
pOperator
->
pTaskInfo
;
SSysTableScanInfo
*
pInfo
=
pOperator
->
info
;
SNode
*
pCondition
=
pInfo
->
pCondition
;
if
(
pOperator
->
status
==
OP_EXEC_DONE
)
{
return
NULL
;
}
// the retrieve is executed on the mnode, so return tables that belongs to the information schema database.
if
(
pInfo
->
readHandle
.
mnd
!=
NULL
)
{
buildSysDbTableInfo
(
pInfo
,
pOperator
->
resultInfo
.
capacity
);
doFilterResult
(
pInfo
);
pInfo
->
loadInfo
.
totalRows
+=
pInfo
->
pRes
->
info
.
rows
;
doSetOperatorCompleted
(
pOperator
);
return
(
pInfo
->
pRes
->
info
.
rows
==
0
)
?
NULL
:
pInfo
->
pRes
;
}
else
{
if
(
pCondition
!=
NULL
)
{
return
NULL
;
}
else
{
return
sysTableBuildUserTables
(
pOperator
);
}
}
return
NULL
;
}
static
SSDataBlock
*
sysTableScanUserSTables
(
SOperatorInfo
*
pOperator
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录