fix(query): revise system table schema.

This commit is contained in:
Haojun Liao 2022-04-13 20:00:59 +08:00
parent b62d0dd521
commit 7cc56c8f1c
3 changed files with 6 additions and 5 deletions

View File

@ -1388,9 +1388,9 @@ static void dumpDbInfoData(SSDataBlock* pBlock, SDbObj *pDb, SShowObj *pShow, in
char tmp[128] = {0}; char tmp[128] = {0};
int32_t len = 0; int32_t len = 0;
if (pDb->cfg.daysToKeep0 > pDb->cfg.daysToKeep1 || pDb->cfg.daysToKeep0 > pDb->cfg.daysToKeep2) { if (pDb->cfg.daysToKeep0 > pDb->cfg.daysToKeep1 || pDb->cfg.daysToKeep0 > pDb->cfg.daysToKeep2) {
len = sprintf(&tmp[2], "%d,%d,%d", pDb->cfg.daysToKeep1, pDb->cfg.daysToKeep2, pDb->cfg.daysToKeep0); len = sprintf(&tmp[VARSTR_HEADER_SIZE], "%d,%d,%d", pDb->cfg.daysToKeep1, pDb->cfg.daysToKeep2, pDb->cfg.daysToKeep0);
} else { } else {
len = sprintf(&tmp[2], "%d,%d,%d", pDb->cfg.daysToKeep0, pDb->cfg.daysToKeep1, pDb->cfg.daysToKeep2); len = sprintf(&tmp[VARSTR_HEADER_SIZE], "%d,%d,%d", pDb->cfg.daysToKeep0, pDb->cfg.daysToKeep1, pDb->cfg.daysToKeep2);
} }
varDataSetLen(tmp, len); varDataSetLen(tmp, len);

View File

@ -67,8 +67,8 @@ static const SInfosTableSchema userDBSchema[] = {
{.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP}, {.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP},
{.name = "vgroups", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT}, {.name = "vgroups", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT},
{.name = "ntables", .bytes = 8, .type = TSDB_DATA_TYPE_BIGINT}, {.name = "ntables", .bytes = 8, .type = TSDB_DATA_TYPE_BIGINT},
{.name = "replica", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT}, {.name = "replica", .bytes = 2, .type = TSDB_DATA_TYPE_TINYINT},
{.name = "quorum", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT}, {.name = "quorum", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT},
{.name = "days", .bytes = 4, .type = TSDB_DATA_TYPE_INT}, {.name = "days", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
{.name = "keep", .bytes = 24 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY}, {.name = "keep", .bytes = 24 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
{.name = "cache", .bytes = 4, .type = TSDB_DATA_TYPE_INT}, {.name = "cache", .bytes = 4, .type = TSDB_DATA_TYPE_INT},

View File

@ -99,7 +99,7 @@ sql create database db
sql show databases sql show databases
print rows: $rows print rows: $rows
print $data0_db $data1_db $data2_db $data3_db $data4_db $data5_db $data6_db $data7_db $data8_db $data9_db $data10_db $data11_db $data12_db $data13_db $data14_db $data15_db $data16_db $data17_db print $data0_db $data1_db $data2_db $data3_db $data4_db $data5_db $data6_db $data7_db $data8_db $data9_db $data10_db $data11_db $data12_db $data13_db $data14_db $data15_db $data16_db $data17_db
if $rows != 2 then if $rows != 3 then
return -1 return -1
endi endi
if $data0_db != db then # name if $data0_db != db then # name
@ -112,6 +112,7 @@ if $data3_db != 0 then # ntables
return -1 return -1
endi endi
if $data4_db != 1 then # replica if $data4_db != 1 then # replica
print expect 1, actual: $data4_db
return -1 return -1
endi endi
if $data5_db != 1 then # quorum if $data5_db != 1 then # quorum