Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a85e30ef
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
Star
22018
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看板
提交
a85e30ef
编写于
3月 17, 2023
作者:
K
kailixu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: select ins_columns from stb/ctb
上级
7ed966e3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
38 deletion
+31
-38
source/libs/executor/src/sysscanoperator.c
source/libs/executor/src/sysscanoperator.c
+6
-2
tests/system-test/0-others/information_schema.py
tests/system-test/0-others/information_schema.py
+25
-36
未找到文件。
source/libs/executor/src/sysscanoperator.c
浏览文件 @
a85e30ef
...
...
@@ -57,6 +57,7 @@ typedef struct SSysTableScanInfo {
const
char
*
pUser
;
bool
sysInfo
;
bool
showRewrite
;
bool
resume
;
SNode
*
pCondition
;
// db_name filter condition, to discard data that are not in current database
SMTbCursor
*
pCur
;
// cursor for iterate the local table meta store.
SSysTableIndex
*
pIdx
;
// idx for local table meta
...
...
@@ -520,12 +521,15 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) {
taosHashSetFreeFp
(
pInfo
->
pSchema
,
tDeleteSSchemaWrapperForHash
);
}
while
((
ret
=
metaTbCursorNext
(
pInfo
->
pCur
,
TSDB_TABLE_MAX
))
==
0
)
{
int32_t
resume
=
pInfo
->
resume
;
pInfo
->
resume
=
false
;
while
(
resume
||
((
ret
=
metaTbCursorNext
(
pInfo
->
pCur
,
TSDB_TABLE_MAX
))
==
0
))
{
char
typeName
[
TSDB_TABLE_FNAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
char
tableName
[
TSDB_TABLE_NAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
SSchemaWrapper
*
schemaRow
=
NULL
;
if
(
resume
)
resume
=
false
;
if
(
pInfo
->
pCur
->
mr
.
me
.
type
==
TSDB_SUPER_TABLE
)
{
qDebug
(
"sysTableScanUserCols cursor get super table"
);
void
*
schema
=
taosHashGet
(
pInfo
->
pSchema
,
&
pInfo
->
pCur
->
mr
.
me
.
uid
,
sizeof
(
int64_t
));
...
...
@@ -572,7 +576,7 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) {
if
((
numOfRows
+
schemaRow
->
nCols
)
>
pOperator
->
resultInfo
.
capacity
)
{
relocateAndFilterSysTagsScanResult
(
pInfo
,
numOfRows
,
dataBlock
,
pOperator
->
exprSupp
.
pFilterInfo
);
numOfRows
=
0
;
metaTbCursorPrev
(
pInfo
->
pCur
)
;
pInfo
->
resume
=
true
;
if
(
pInfo
->
pRes
->
info
.
rows
>
0
)
{
break
;
...
...
tests/system-test/0-others/information_schema.py
浏览文件 @
a85e30ef
...
...
@@ -101,47 +101,36 @@ class TDTestCase:
tdSql
.
checkEqual
(
i
[
1
],
len
(
self
.
perf_list
))
elif
i
[
0
].
lower
()
==
self
.
dbname
:
tdSql
.
checkEqual
(
i
[
1
],
self
.
tbnum
+
1
)
# def ins_columns_check(self):
# tdSql.execute('drop database if exists db2')
# tdSql.execute('create database if not exists db2 vgroups 2 replica 1')
# tdSql.execute('create table db2.stb2 (ts timestamp,c0 int,c1 int, c2 double, c3 float, c4 binary(1000), c5 nchar(100),c7 bigint, c8 bool, c9 smallint) tags(t0 int)')
# for i in range(2000):
# tdSql.execute("create table db2.ctb%d using db2.stb2 tags(%d)" %(i,i))
# tdSql.query(f'select * from information_schema.ins_columns where db_name="db2" and table_type="CHILD_TABLE"')
# tdSql.checkEqual(20000,len(tdSql.queryResult))
# print("number of ins_columns of child table in db2 is %s" % len(tdSql.queryResult))
# def ins_columns_check(self):
# tdSql.execute('drop database if exists db2')
# tdSql.execute('create database if not exists db2 vgroups 1 replica 1')
# for i in range (5):
# self.stb4096 = 'create table db2.stb%d (ts timestamp' % (i)
# for j in range (4094 - i):
# # for j in range (499):
# self.stb4096 += ', c%d int' % (j)
# self.stb4096 += ') tags (t1 int)'
# tdSql.execute(self.stb4096)
# # print ("stb sql is %s" % (self.stb4096))
# for k in range(10):
# tdSql.execute("create table db2.ctb_%d_%dc using db2.stb%d tags(%d)" %(i,k,i,k))
# tdSql.query(f'select * from information_schema.ins_columns where db_name="db2" and table_type=="SUPER_TABLE"')
# tdSql.checkEqual(20465,len(tdSql.queryResult))
# tdSql.query(f'select * from information_schema.ins_columns where db_name="db2" and table_type=="CHILD_TABLE"')
# tdSql.checkEqual(20465,len(tdSql.queryResult))
def
ins_columns_check
(
self
):
tdSql
.
execute
(
'drop database if exists db2'
)
tdSql
.
execute
(
'create database if not exists db2 vgroups 1 replica 1'
)
for
i
in
range
(
5
):
self
.
stb4096
=
'create table db2.stb%d (ts timestamp'
%
(
i
)
for
j
in
range
(
4094
-
i
):
# for j in range (499):
self
.
stb4096
+=
', c%d int'
%
(
j
)
self
.
stb4096
+=
') tags (t1 int)'
tdSql
.
execute
(
self
.
stb4096
)
for
k
in
range
(
10
):
tdSql
.
execute
(
"create table db2.ctb_%d_%dc using db2.stb%d tags(%d)"
%
(
i
,
k
,
i
,
k
))
tdSql
.
query
(
f
'select * from information_schema.ins_columns where db_name="db2" and table_type=="SUPER_TABLE"'
)
tdSql
.
checkEqual
(
20465
,
len
(
tdSql
.
queryResult
))
tdSql
.
query
(
f
'select * from information_schema.ins_columns where db_name="db2" and table_type=="CHILD_TABLE"'
)
tdSql
.
checkEqual
(
204650
,
len
(
tdSql
.
queryResult
))
# for j in range (5):
# self.ntb4096 = 'create table db2.ntb%d (ts timestamp' % (j)
# for i in range (4095 - j):
# self.ntb4096 += ', c%d binary(10)' % (i)
# self.ntb4096 += ')'
# tdSql.execute(self.ntb4096)
# # print ("ntb sql is %s" % (self.ntb4096))
# tdSql.query(f'select * from information_schema.ins_columns where db_name="db2" and table_type=="NORMAL_TABLE"')
# tdSql.checkEqual(20000,len(tdSql.queryResult))
for
i
in
range
(
5
):
self
.
ntb4096
=
'create table db2.ntb%d (ts timestamp'
%
(
i
)
for
j
in
range
(
4095
-
i
):
self
.
ntb4096
+=
', c%d binary(10)'
%
(
j
)
self
.
ntb4096
+=
')'
tdSql
.
execute
(
self
.
ntb4096
)
tdSql
.
query
(
f
'select * from information_schema.ins_columns where db_name="db2" and table_type=="NORMAL_TABLE"'
)
tdSql
.
checkEqual
(
204700
,
len
(
tdSql
.
queryResult
))
def
run
(
self
):
self
.
prepare_data
()
self
.
count_check
()
#
self.ins_columns_check()
self
.
ins_columns_check
()
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录