提交 ed3fc6bd 编写于 作者: K kailixu

fix: select ins_columns from stb/ctb

上级 a85e30ef
......@@ -547,21 +547,21 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) {
if (schema != NULL) {
schemaRow = *(SSchemaWrapper**)schema;
} else {
SMetaReader metaReader = {0};
metaReaderInit(&metaReader, pInfo->readHandle.meta, 0);
int code = metaGetTableEntryByUid(&metaReader, suid);
SMetaReader smrSuperTable = {0};
metaReaderInit(&smrSuperTable, pInfo->readHandle.meta, 0);
int code = metaGetTableEntryByUid(&smrSuperTable, suid);
if (code != TSDB_CODE_SUCCESS) {
// terrno has been set by metaGetTableEntryByName, therefore, return directly
qError("sysTableScanUserCols get meta by suid:%" PRId64 " error, code:%d", suid, code);
metaReaderClear(&metaReader);
metaReaderClear(&smrSuperTable);
blockDataDestroy(dataBlock);
pInfo->loadInfo.totalRows = 0;
return NULL;
}
SSchemaWrapper* schemaWrapper = tCloneSSchemaWrapper(&metaReader.me.stbEntry.schemaRow);
SSchemaWrapper* schemaWrapper = tCloneSSchemaWrapper(&smrSuperTable.me.stbEntry.schemaRow);
taosHashPut(pInfo->pSchema, &suid, sizeof(int64_t), &schemaWrapper, POINTER_BYTES);
schemaRow = schemaWrapper;
metaReaderClear(&metaReader);
metaReaderClear(&smrSuperTable);
}
} else if (pInfo->pCur->mr.me.type == TSDB_NORMAL_TABLE) {
qDebug("sysTableScanUserCols cursor get normal table");
......
......@@ -107,7 +107,6 @@ class TDTestCase:
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)
......@@ -125,7 +124,7 @@ class TDTestCase:
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))
tdSql.checkEqual(20470,len(tdSql.queryResult))
def run(self):
self.prepare_data()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册