Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3ab55496
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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,发现更多精彩内容 >>
未验证
提交
3ab55496
编写于
3月 21, 2023
作者:
D
dapan1121
提交者:
GitHub
3月 21, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #20561 from taosdata/fix/TS-2891-M
fix: select ins_columns from stb/tb
上级
1056c987
aa4c1cb5
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
96 addition
and
23 deletion
+96
-23
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+1
-0
source/dnode/mnode/impl/src/mndShow.c
source/dnode/mnode/impl/src/mndShow.c
+1
-1
source/dnode/mnode/impl/src/mndStb.c
source/dnode/mnode/impl/src/mndStb.c
+22
-2
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+1
-1
source/dnode/vnode/src/meta/metaQuery.c
source/dnode/vnode/src/meta/metaQuery.c
+2
-2
source/libs/executor/src/sysscanoperator.c
source/libs/executor/src/sysscanoperator.c
+40
-17
tests/system-test/0-others/information_schema.py
tests/system-test/0-others/information_schema.py
+29
-0
未找到文件。
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
3ab55496
...
@@ -457,6 +457,7 @@ typedef struct {
...
@@ -457,6 +457,7 @@ typedef struct {
void
*
pIter
;
void
*
pIter
;
SMnode
*
pMnode
;
SMnode
*
pMnode
;
STableMetaRsp
*
pMeta
;
STableMetaRsp
*
pMeta
;
bool
restore
;
bool
sysDbRsp
;
bool
sysDbRsp
;
char
db
[
TSDB_DB_FNAME_LEN
];
char
db
[
TSDB_DB_FNAME_LEN
];
char
filterTb
[
TSDB_TABLE_NAME_LEN
];
char
filterTb
[
TSDB_TABLE_NAME_LEN
];
...
...
source/dnode/mnode/impl/src/mndShow.c
浏览文件 @
3ab55496
...
@@ -324,7 +324,7 @@ static int32_t mndProcessRetrieveSysTableReq(SRpcMsg *pReq) {
...
@@ -324,7 +324,7 @@ static int32_t mndProcessRetrieveSysTableReq(SRpcMsg *pReq) {
pReq
->
info
.
rsp
=
pRsp
;
pReq
->
info
.
rsp
=
pRsp
;
pReq
->
info
.
rspLen
=
size
;
pReq
->
info
.
rspLen
=
size
;
if
(
rowsRead
==
0
||
rowsRead
<
rowsToRead
)
{
if
(
rowsRead
==
0
||
((
rowsRead
<
rowsToRead
)
&&
!
pShow
->
restore
)
)
{
pRsp
->
completed
=
1
;
pRsp
->
completed
=
1
;
mDebug
(
"show:0x%"
PRIx64
", retrieve completed"
,
pShow
->
id
);
mDebug
(
"show:0x%"
PRIx64
", retrieve completed"
,
pShow
->
id
);
mndReleaseShowObj
(
pShow
,
true
);
mndReleaseShowObj
(
pShow
,
true
);
...
...
source/dnode/mnode/impl/src/mndStb.c
浏览文件 @
3ab55496
...
@@ -3113,9 +3113,18 @@ static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
...
@@ -3113,9 +3113,18 @@ static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
char
typeName
[
TSDB_TABLE_FNAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
char
typeName
[
TSDB_TABLE_FNAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_TO_VARSTR
(
typeName
,
"SUPER_TABLE"
);
STR_TO_VARSTR
(
typeName
,
"SUPER_TABLE"
);
bool
fetch
=
pShow
->
restore
?
false
:
true
;
pShow
->
restore
=
false
;
while
(
numOfRows
<
rows
)
{
while
(
numOfRows
<
rows
)
{
if
(
fetch
)
{
pShow
->
pIter
=
sdbFetch
(
pSdb
,
SDB_STB
,
pShow
->
pIter
,
(
void
**
)
&
pStb
);
pShow
->
pIter
=
sdbFetch
(
pSdb
,
SDB_STB
,
pShow
->
pIter
,
(
void
**
)
&
pStb
);
if
(
pShow
->
pIter
==
NULL
)
break
;
if
(
pShow
->
pIter
==
NULL
)
break
;
}
else
{
fetch
=
true
;
void
*
pKey
=
taosHashGetKey
(
pShow
->
pIter
,
NULL
);
pStb
=
sdbAcquire
(
pSdb
,
SDB_STB
,
pKey
);
if
(
!
pStb
)
continue
;
}
if
(
pDb
!=
NULL
&&
pStb
->
dbUid
!=
pDb
->
uid
)
{
if
(
pDb
!=
NULL
&&
pStb
->
dbUid
!=
pDb
->
uid
)
{
sdbRelease
(
pSdb
,
pStb
);
sdbRelease
(
pSdb
,
pStb
);
...
@@ -3129,6 +3138,17 @@ static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
...
@@ -3129,6 +3138,17 @@ static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
sdbRelease
(
pSdb
,
pStb
);
sdbRelease
(
pSdb
,
pStb
);
continue
;
continue
;
}
}
if
((
numOfRows
+
pStb
->
numOfColumns
)
>
rows
)
{
pShow
->
restore
=
true
;
if
(
numOfRows
==
0
)
{
mError
(
"mndRetrieveStbCol failed to get stable cols since buf:%d less than result:%d, stable name:%s, db:%s"
,
rows
,
pStb
->
numOfColumns
,
pStb
->
name
,
pStb
->
db
);
}
sdbRelease
(
pSdb
,
pStb
);
break
;
}
varDataSetLen
(
stbName
,
strlen
(
&
stbName
[
VARSTR_HEADER_SIZE
]));
varDataSetLen
(
stbName
,
strlen
(
&
stbName
[
VARSTR_HEADER_SIZE
]));
mDebug
(
"mndRetrieveStbCol get stable cols, stable name:%s, db:%s"
,
pStb
->
name
,
pStb
->
db
);
mDebug
(
"mndRetrieveStbCol get stable cols, stable name:%s, db:%s"
,
pStb
->
name
,
pStb
->
db
);
...
...
source/dnode/vnode/inc/vnode.h
浏览文件 @
3ab55496
...
@@ -157,7 +157,7 @@ typedef struct SMTbCursor SMTbCursor;
...
@@ -157,7 +157,7 @@ typedef struct SMTbCursor SMTbCursor;
SMTbCursor
*
metaOpenTbCursor
(
SMeta
*
pMeta
);
SMTbCursor
*
metaOpenTbCursor
(
SMeta
*
pMeta
);
void
metaCloseTbCursor
(
SMTbCursor
*
pTbCur
);
void
metaCloseTbCursor
(
SMTbCursor
*
pTbCur
);
int32_t
metaTbCursorNext
(
SMTbCursor
*
pTbCur
,
ETableType
jumpTableType
);
int32_t
metaTbCursorNext
(
SMTbCursor
*
pTbCur
,
ETableType
jumpTableType
);
int32_t
metaTbCursorPrev
(
SMTbCursor
*
pTbCur
);
int32_t
metaTbCursorPrev
(
SMTbCursor
*
pTbCur
,
ETableType
jumpTableType
);
#endif
#endif
...
...
source/dnode/vnode/src/meta/metaQuery.c
浏览文件 @
3ab55496
...
@@ -336,7 +336,7 @@ int32_t metaTbCursorNext(SMTbCursor *pTbCur, ETableType jumpTableType) {
...
@@ -336,7 +336,7 @@ int32_t metaTbCursorNext(SMTbCursor *pTbCur, ETableType jumpTableType) {
return
0
;
return
0
;
}
}
int32_t
metaTbCursorPrev
(
SMTbCursor
*
pTbCur
)
{
int32_t
metaTbCursorPrev
(
SMTbCursor
*
pTbCur
,
ETableType
jumpTableType
)
{
int
ret
;
int
ret
;
void
*
pBuf
;
void
*
pBuf
;
STbCfg
tbCfg
;
STbCfg
tbCfg
;
...
@@ -350,7 +350,7 @@ int32_t metaTbCursorPrev(SMTbCursor *pTbCur) {
...
@@ -350,7 +350,7 @@ int32_t metaTbCursorPrev(SMTbCursor *pTbCur) {
tDecoderClear
(
&
pTbCur
->
mr
.
coder
);
tDecoderClear
(
&
pTbCur
->
mr
.
coder
);
metaGetTableEntryByVersion
(
&
pTbCur
->
mr
,
((
SUidIdxVal
*
)
pTbCur
->
pVal
)[
0
].
version
,
*
(
tb_uid_t
*
)
pTbCur
->
pKey
);
metaGetTableEntryByVersion
(
&
pTbCur
->
mr
,
((
SUidIdxVal
*
)
pTbCur
->
pVal
)[
0
].
version
,
*
(
tb_uid_t
*
)
pTbCur
->
pKey
);
if
(
pTbCur
->
mr
.
me
.
type
==
TSDB_SUPER_TABLE
)
{
if
(
pTbCur
->
mr
.
me
.
type
==
jumpTableType
)
{
continue
;
continue
;
}
}
...
...
source/libs/executor/src/sysscanoperator.c
浏览文件 @
3ab55496
...
@@ -57,9 +57,11 @@ typedef struct SSysTableScanInfo {
...
@@ -57,9 +57,11 @@ typedef struct SSysTableScanInfo {
const
char
*
pUser
;
const
char
*
pUser
;
bool
sysInfo
;
bool
sysInfo
;
bool
showRewrite
;
bool
showRewrite
;
bool
restore
;
SNode
*
pCondition
;
// db_name filter condition, to discard data that are not in current database
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.
SMTbCursor
*
pCur
;
// cursor for iterate the local table meta store.
SSysTableIndex
*
pIdx
;
// idx for local table meta
SSysTableIndex
*
pIdx
;
// idx for local table meta
SHashObj
*
pSchema
;
SColMatchInfo
matchInfo
;
SColMatchInfo
matchInfo
;
SName
name
;
SName
name
;
SSDataBlock
*
pRes
;
SSDataBlock
*
pRes
;
...
@@ -514,9 +516,23 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) {
...
@@ -514,9 +516,23 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) {
pInfo
->
pCur
=
metaOpenTbCursor
(
pInfo
->
readHandle
.
meta
);
pInfo
->
pCur
=
metaOpenTbCursor
(
pInfo
->
readHandle
.
meta
);
}
}
SHashObj
*
stableSchema
=
taosHashInit
(
64
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BIGINT
),
false
,
HASH_NO_LOCK
);
if
(
pInfo
->
pSchema
==
NULL
)
{
taosHashSetFreeFp
(
stableSchema
,
tDeleteSSchemaWrapperForHash
);
pInfo
->
pSchema
=
taosHashInit
(
64
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BIGINT
),
true
,
HASH_NO_LOCK
);
while
((
ret
=
metaTbCursorNext
(
pInfo
->
pCur
,
TSDB_TABLE_MAX
))
==
0
)
{
taosHashSetFreeFp
(
pInfo
->
pSchema
,
tDeleteSSchemaWrapperForHash
);
}
if
(
!
pInfo
->
pCur
||
!
pInfo
->
pSchema
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
qError
(
"sysTableScanUserCols failed since %s"
,
terrstr
(
terrno
));
blockDataDestroy
(
dataBlock
);
pInfo
->
loadInfo
.
totalRows
=
0
;
return
NULL
;
}
int32_t
restore
=
pInfo
->
restore
;
pInfo
->
restore
=
false
;
while
(
restore
||
((
ret
=
metaTbCursorNext
(
pInfo
->
pCur
,
TSDB_TABLE_MAX
))
==
0
))
{
if
(
restore
)
restore
=
false
;
char
typeName
[
TSDB_TABLE_FNAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
char
typeName
[
TSDB_TABLE_FNAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
char
tableName
[
TSDB_TABLE_NAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
char
tableName
[
TSDB_TABLE_NAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
...
@@ -524,33 +540,36 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) {
...
@@ -524,33 +540,36 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) {
if
(
pInfo
->
pCur
->
mr
.
me
.
type
==
TSDB_SUPER_TABLE
)
{
if
(
pInfo
->
pCur
->
mr
.
me
.
type
==
TSDB_SUPER_TABLE
)
{
qDebug
(
"sysTableScanUserCols cursor get super table"
);
qDebug
(
"sysTableScanUserCols cursor get super table"
);
void
*
schema
=
taosHashGet
(
stable
Schema
,
&
pInfo
->
pCur
->
mr
.
me
.
uid
,
sizeof
(
int64_t
));
void
*
schema
=
taosHashGet
(
pInfo
->
p
Schema
,
&
pInfo
->
pCur
->
mr
.
me
.
uid
,
sizeof
(
int64_t
));
if
(
schema
==
NULL
)
{
if
(
schema
==
NULL
)
{
SSchemaWrapper
*
schemaWrapper
=
tCloneSSchemaWrapper
(
&
pInfo
->
pCur
->
mr
.
me
.
stbEntry
.
schemaRow
);
SSchemaWrapper
*
schemaWrapper
=
tCloneSSchemaWrapper
(
&
pInfo
->
pCur
->
mr
.
me
.
stbEntry
.
schemaRow
);
taosHashPut
(
stable
Schema
,
&
pInfo
->
pCur
->
mr
.
me
.
uid
,
sizeof
(
int64_t
),
&
schemaWrapper
,
POINTER_BYTES
);
taosHashPut
(
pInfo
->
p
Schema
,
&
pInfo
->
pCur
->
mr
.
me
.
uid
,
sizeof
(
int64_t
),
&
schemaWrapper
,
POINTER_BYTES
);
}
}
continue
;
continue
;
}
else
if
(
pInfo
->
pCur
->
mr
.
me
.
type
==
TSDB_CHILD_TABLE
)
{
}
else
if
(
pInfo
->
pCur
->
mr
.
me
.
type
==
TSDB_CHILD_TABLE
)
{
qDebug
(
"sysTableScanUserCols cursor get child table"
);
qDebug
(
"sysTableScanUserCols cursor get child table"
);
STR_TO_VARSTR
(
typeName
,
"CHILD_TABLE"
);
STR_TO_VARSTR
(
typeName
,
"CHILD_TABLE"
);
STR_TO_VARSTR
(
tableName
,
pInfo
->
pCur
->
mr
.
me
.
name
);
STR_TO_VARSTR
(
tableName
,
pInfo
->
pCur
->
mr
.
me
.
name
);
int64_t
suid
=
pInfo
->
pCur
->
mr
.
me
.
ctbEntry
.
suid
;
int64_t
suid
=
pInfo
->
pCur
->
mr
.
me
.
ctbEntry
.
suid
;
void
*
schema
=
taosHashGet
(
stable
Schema
,
&
pInfo
->
pCur
->
mr
.
me
.
ctbEntry
.
suid
,
sizeof
(
int64_t
));
void
*
schema
=
taosHashGet
(
pInfo
->
p
Schema
,
&
pInfo
->
pCur
->
mr
.
me
.
ctbEntry
.
suid
,
sizeof
(
int64_t
));
if
(
schema
!=
NULL
)
{
if
(
schema
!=
NULL
)
{
schemaRow
=
*
(
SSchemaWrapper
**
)
schema
;
schemaRow
=
*
(
SSchemaWrapper
**
)
schema
;
}
else
{
}
else
{
tDecoderClear
(
&
pInfo
->
pCur
->
mr
.
coder
);
SMetaReader
smrSuperTable
=
{
0
};
int
code
=
metaGetTableEntryByUid
(
&
pInfo
->
pCur
->
mr
,
suid
);
metaReaderInit
(
&
smrSuperTable
,
pInfo
->
readHandle
.
meta
,
0
);
int
code
=
metaGetTableEntryByUid
(
&
smrSuperTable
,
suid
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
// terrno has been set by metaGetTableEntryByName, therefore, return directly
// terrno has been set by metaGetTableEntryByName, therefore, return directly
qError
(
"sysTableScanUserCols get meta by suid:%"
PRId64
" error, code:%d"
,
suid
,
code
);
qError
(
"sysTableScanUserCols get meta by suid:%"
PRId64
" error, code:%d"
,
suid
,
code
);
metaReaderClear
(
&
smrSuperTable
);
blockDataDestroy
(
dataBlock
);
blockDataDestroy
(
dataBlock
);
pInfo
->
loadInfo
.
totalRows
=
0
;
pInfo
->
loadInfo
.
totalRows
=
0
;
taosHashCleanup
(
stableSchema
);
return
NULL
;
return
NULL
;
}
}
schemaRow
=
&
pInfo
->
pCur
->
mr
.
me
.
stbEntry
.
schemaRow
;
SSchemaWrapper
*
schemaWrapper
=
tCloneSSchemaWrapper
(
&
smrSuperTable
.
me
.
stbEntry
.
schemaRow
);
taosHashPut
(
pInfo
->
pSchema
,
&
suid
,
sizeof
(
int64_t
),
&
schemaWrapper
,
POINTER_BYTES
);
schemaRow
=
schemaWrapper
;
metaReaderClear
(
&
smrSuperTable
);
}
}
}
else
if
(
pInfo
->
pCur
->
mr
.
me
.
type
==
TSDB_NORMAL_TABLE
)
{
}
else
if
(
pInfo
->
pCur
->
mr
.
me
.
type
==
TSDB_NORMAL_TABLE
)
{
qDebug
(
"sysTableScanUserCols cursor get normal table"
);
qDebug
(
"sysTableScanUserCols cursor get normal table"
);
...
@@ -562,20 +581,19 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) {
...
@@ -562,20 +581,19 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) {
continue
;
continue
;
}
}
sysTableUserColsFillOneTableCols
(
pInfo
,
dbname
,
&
numOfRows
,
dataBlock
,
tableName
,
schemaRow
,
typeName
);
if
((
numOfRows
+
schemaRow
->
nCols
)
>
pOperator
->
resultInfo
.
capacity
)
{
if
(
numOfRows
>=
pOperator
->
resultInfo
.
capacity
)
{
relocateAndFilterSysTagsScanResult
(
pInfo
,
numOfRows
,
dataBlock
,
pOperator
->
exprSupp
.
pFilterInfo
);
relocateAndFilterSysTagsScanResult
(
pInfo
,
numOfRows
,
dataBlock
,
pOperator
->
exprSupp
.
pFilterInfo
);
numOfRows
=
0
;
numOfRows
=
0
;
pInfo
->
restore
=
true
;
if
(
pInfo
->
pRes
->
info
.
rows
>
0
)
{
if
(
pInfo
->
pRes
->
info
.
rows
>
0
)
{
break
;
break
;
}
}
}
else
{
sysTableUserColsFillOneTableCols
(
pInfo
,
dbname
,
&
numOfRows
,
dataBlock
,
tableName
,
schemaRow
,
typeName
);
}
}
}
}
taosHashCleanup
(
stableSchema
);
if
(
numOfRows
>
0
)
{
if
(
numOfRows
>
0
)
{
relocateAndFilterSysTagsScanResult
(
pInfo
,
numOfRows
,
dataBlock
,
pOperator
->
exprSupp
.
pFilterInfo
);
relocateAndFilterSysTagsScanResult
(
pInfo
,
numOfRows
,
dataBlock
,
pOperator
->
exprSupp
.
pFilterInfo
);
numOfRows
=
0
;
numOfRows
=
0
;
...
@@ -695,7 +713,7 @@ static SSDataBlock* sysTableScanUserTags(SOperatorInfo* pOperator) {
...
@@ -695,7 +713,7 @@ static SSDataBlock* sysTableScanUserTags(SOperatorInfo* pOperator) {
}
}
if
((
smrSuperTable
.
me
.
stbEntry
.
schemaTag
.
nCols
+
numOfRows
)
>
pOperator
->
resultInfo
.
capacity
)
{
if
((
smrSuperTable
.
me
.
stbEntry
.
schemaTag
.
nCols
+
numOfRows
)
>
pOperator
->
resultInfo
.
capacity
)
{
metaTbCursorPrev
(
pInfo
->
pCur
);
metaTbCursorPrev
(
pInfo
->
pCur
,
TSDB_TABLE_MAX
);
blockFull
=
true
;
blockFull
=
true
;
}
else
{
}
else
{
sysTableUserTagsFillOneTableTags
(
pInfo
,
&
smrSuperTable
,
&
pInfo
->
pCur
->
mr
,
dbname
,
tableName
,
&
numOfRows
,
sysTableUserTagsFillOneTableTags
(
pInfo
,
&
smrSuperTable
,
&
pInfo
->
pCur
->
mr
,
dbname
,
tableName
,
&
numOfRows
,
...
@@ -1789,6 +1807,11 @@ void destroySysScanOperator(void* param) {
...
@@ -1789,6 +1807,11 @@ void destroySysScanOperator(void* param) {
pInfo
->
pIdx
=
NULL
;
pInfo
->
pIdx
=
NULL
;
}
}
if
(
pInfo
->
pSchema
)
{
taosHashCleanup
(
pInfo
->
pSchema
);
pInfo
->
pSchema
=
NULL
;
}
taosArrayDestroy
(
pInfo
->
matchInfo
.
pList
);
taosArrayDestroy
(
pInfo
->
matchInfo
.
pList
);
taosMemoryFreeClear
(
pInfo
->
pUser
);
taosMemoryFreeClear
(
pInfo
->
pUser
);
...
...
tests/system-test/0-others/information_schema.py
浏览文件 @
3ab55496
...
@@ -101,9 +101,38 @@ class TDTestCase:
...
@@ -101,9 +101,38 @@ class TDTestCase:
tdSql
.
checkEqual
(
i
[
1
],
len
(
self
.
perf_list
))
tdSql
.
checkEqual
(
i
[
1
],
len
(
self
.
perf_list
))
elif
i
[
0
].
lower
()
==
self
.
dbname
:
elif
i
[
0
].
lower
()
==
self
.
dbname
:
tdSql
.
checkEqual
(
i
[
1
],
self
.
tbnum
+
1
)
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 1 replica 1'
)
for
i
in
range
(
5
):
self
.
stb4096
=
'create table db2.stb%d (ts timestamp'
%
(
i
)
for
j
in
range
(
4094
-
i
):
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
))
for
t
in
range
(
2
):
tdSql
.
query
(
f
'select * from information_schema.ins_columns where db_name="db2" and table_type=="SUPER_TABLE"'
)
tdSql
.
checkEqual
(
20465
,
len
(
tdSql
.
queryResult
))
for
t
in
range
(
2
):
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
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
)
for
t
in
range
(
2
):
tdSql
.
query
(
f
'select * from information_schema.ins_columns where db_name="db2" and table_type=="NORMAL_TABLE"'
)
tdSql
.
checkEqual
(
20470
,
len
(
tdSql
.
queryResult
))
def
run
(
self
):
def
run
(
self
):
self
.
prepare_data
()
self
.
prepare_data
()
self
.
count_check
()
self
.
count_check
()
self
.
ins_columns_check
()
def
stop
(
self
):
def
stop
(
self
):
tdSql
.
close
()
tdSql
.
close
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录