提交 3e1b7503 编写于 作者: H Haojun Liao

[td-13039] fix bug in show tables;

上级 b0bc2434
......@@ -86,8 +86,9 @@ static const SInfosTableSchema userStreamsSchema[] = {{.name = "stream_name", .
{.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP},
{.name = "sql", .bytes = 1024, .type = TSDB_DATA_TYPE_BINARY},
};
static const SInfosTableSchema userTblsSchema[] = {{.name = "db_name", .bytes = 32, .type = TSDB_DATA_TYPE_BINARY},
static const SInfosTableSchema userTblsSchema[] = {
{.name = "table_name", .bytes = 192, .type = TSDB_DATA_TYPE_BINARY},
{.name = "db_name", .bytes = 32, .type = TSDB_DATA_TYPE_BINARY},
{.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP},
{.name = "columns", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
{.name = "stable_name", .bytes = 192, .type = TSDB_DATA_TYPE_BINARY},
......
......@@ -5482,7 +5482,7 @@ static SSDataBlock* doSysTableScan(void* param, bool* newgroup) {
blockDataClearup(pInfo->pRes, true);
SColumnInfoData* pTableNameCol = taosArrayGet(pInfo->pRes->pDataBlock, 0);
SColumnInfoData* pTableNameCol = taosArrayGet(pInfo->pRes->pDataBlock, 1);
char * name = NULL;
int32_t numOfRows = 0;
......@@ -5495,6 +5495,22 @@ static SSDataBlock* doSysTableScan(void* param, bool* newgroup) {
if (numOfRows >= pInfo->capacity) {
break;
}
for(int32_t i = 0; i < pInfo->pRes->info.numOfCols; ++i) {
if (i == 1) {
continue;
}
SColumnInfoData* pColInfoData = taosArrayGet(pInfo->pRes->pDataBlock, i);
int64_t tmp = 0;
char t[10] = {0};
STR_TO_VARSTR(t, "_");
if (IS_VAR_DATA_TYPE(pColInfoData->info.type)) {
colDataAppend(pColInfoData, numOfRows, t, false);
} else {
colDataAppend(pColInfoData, numOfRows, (char*) &tmp, false);
}
}
}
pInfo->loadInfo.totalRows += numOfRows;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册