提交 ed3fc6bd 编写于 作者: K kailixu

fix: select ins_columns from stb/ctb

上级 a85e30ef
...@@ -547,21 +547,21 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { ...@@ -547,21 +547,21 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) {
if (schema != NULL) { if (schema != NULL) {
schemaRow = *(SSchemaWrapper**)schema; schemaRow = *(SSchemaWrapper**)schema;
} else { } else {
SMetaReader metaReader = {0}; SMetaReader smrSuperTable = {0};
metaReaderInit(&metaReader, pInfo->readHandle.meta, 0); metaReaderInit(&smrSuperTable, pInfo->readHandle.meta, 0);
int code = metaGetTableEntryByUid(&metaReader, suid); 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(&metaReader); metaReaderClear(&smrSuperTable);
blockDataDestroy(dataBlock); blockDataDestroy(dataBlock);
pInfo->loadInfo.totalRows = 0; pInfo->loadInfo.totalRows = 0;
return NULL; 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); taosHashPut(pInfo->pSchema, &suid, sizeof(int64_t), &schemaWrapper, POINTER_BYTES);
schemaRow = schemaWrapper; schemaRow = schemaWrapper;
metaReaderClear(&metaReader); 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");
......
...@@ -107,7 +107,6 @@ class TDTestCase: ...@@ -107,7 +107,6 @@ class TDTestCase:
for i in range (5): for i in range (5):
self.stb4096 = 'create table db2.stb%d (ts timestamp' % (i) self.stb4096 = 'create table db2.stb%d (ts timestamp' % (i)
for j in range (4094 - i): for j in range (4094 - i):
# for j in range (499):
self.stb4096 += ', c%d int' % (j) self.stb4096 += ', c%d int' % (j)
self.stb4096 += ') tags (t1 int)' self.stb4096 += ') tags (t1 int)'
tdSql.execute(self.stb4096) tdSql.execute(self.stb4096)
...@@ -125,7 +124,7 @@ class TDTestCase: ...@@ -125,7 +124,7 @@ class TDTestCase:
self.ntb4096 += ')' self.ntb4096 += ')'
tdSql.execute(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.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): def run(self):
self.prepare_data() self.prepare_data()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册