fix: user permission error with sysinfo 0
This commit is contained in:
parent
1c26d444eb
commit
63792daeeb
|
@ -350,7 +350,7 @@ static const SSysTableMeta perfsMeta[] = {
|
||||||
{TSDB_PERFS_TABLE_SUBSCRIPTIONS, subscriptionSchema, tListLen(subscriptionSchema), false},
|
{TSDB_PERFS_TABLE_SUBSCRIPTIONS, subscriptionSchema, tListLen(subscriptionSchema), false},
|
||||||
// {TSDB_PERFS_TABLE_OFFSETS, offsetSchema, tListLen(offsetSchema)},
|
// {TSDB_PERFS_TABLE_OFFSETS, offsetSchema, tListLen(offsetSchema)},
|
||||||
{TSDB_PERFS_TABLE_TRANS, transSchema, tListLen(transSchema), false},
|
{TSDB_PERFS_TABLE_TRANS, transSchema, tListLen(transSchema), false},
|
||||||
{TSDB_PERFS_TABLE_SMAS, smaSchema, tListLen(smaSchema), false},
|
// {TSDB_PERFS_TABLE_SMAS, smaSchema, tListLen(smaSchema), false},
|
||||||
{TSDB_PERFS_TABLE_STREAMS, streamSchema, tListLen(streamSchema), false},
|
{TSDB_PERFS_TABLE_STREAMS, streamSchema, tListLen(streamSchema), false},
|
||||||
{TSDB_PERFS_TABLE_APPS, appSchema, tListLen(appSchema), false}};
|
{TSDB_PERFS_TABLE_APPS, appSchema, tListLen(appSchema), false}};
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
|
@ -65,8 +65,8 @@ int32_t mndInitSma(SMnode *pMnode) {
|
||||||
mndSetMsgHandle(pMnode, TDMT_MND_GET_INDEX, mndProcessGetSmaReq);
|
mndSetMsgHandle(pMnode, TDMT_MND_GET_INDEX, mndProcessGetSmaReq);
|
||||||
mndSetMsgHandle(pMnode, TDMT_MND_GET_TABLE_INDEX, mndProcessGetTbSmaReq);
|
mndSetMsgHandle(pMnode, TDMT_MND_GET_TABLE_INDEX, mndProcessGetTbSmaReq);
|
||||||
|
|
||||||
mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_SMAS, mndRetrieveSma);
|
mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_INDEX, mndRetrieveSma);
|
||||||
mndAddShowFreeIterHandle(pMnode, TSDB_MGMT_TABLE_SMAS, mndCancelGetNextSma);
|
mndAddShowFreeIterHandle(pMnode, TSDB_MGMT_TABLE_INDEX, mndCancelGetNextSma);
|
||||||
return sdbSetTable(pMnode->pSdb, table);
|
return sdbSetTable(pMnode->pSdb, table);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -568,15 +568,13 @@ TEST_F(ParserInitialCTest, createStream) {
|
||||||
memset(&expect, 0, sizeof(SCMCreateStreamReq));
|
memset(&expect, 0, sizeof(SCMCreateStreamReq));
|
||||||
};
|
};
|
||||||
|
|
||||||
auto setCreateStreamReqFunc = [&](const char* pStream, const char* pSrcDb, const char* pSql,
|
auto setCreateStreamReqFunc = [&](const char* pStream, const char* pSrcDb, const char* pSql, const char* pDstStb,
|
||||||
const char* pDstStb = nullptr, int8_t igExists = 0,
|
int8_t igExists = 0, int8_t triggerType = STREAM_TRIGGER_AT_ONCE,
|
||||||
int8_t triggerType = STREAM_TRIGGER_AT_ONCE, int64_t maxDelay = 0,
|
int64_t maxDelay = 0, int64_t watermark = 0,
|
||||||
int64_t watermark = 0, int8_t igExpired = STREAM_DEFAULT_IGNORE_EXPIRED) {
|
int8_t igExpired = STREAM_DEFAULT_IGNORE_EXPIRED) {
|
||||||
snprintf(expect.name, sizeof(expect.name), "0.%s", pStream);
|
snprintf(expect.name, sizeof(expect.name), "0.%s", pStream);
|
||||||
snprintf(expect.sourceDB, sizeof(expect.sourceDB), "0.%s", pSrcDb);
|
snprintf(expect.sourceDB, sizeof(expect.sourceDB), "0.%s", pSrcDb);
|
||||||
if (NULL != pDstStb) {
|
snprintf(expect.targetStbFullName, sizeof(expect.targetStbFullName), "0.test.%s", pDstStb);
|
||||||
snprintf(expect.targetStbFullName, sizeof(expect.targetStbFullName), "0.test.%s", pDstStb);
|
|
||||||
}
|
|
||||||
expect.igExists = igExists;
|
expect.igExists = igExists;
|
||||||
expect.sql = strdup(pSql);
|
expect.sql = strdup(pSql);
|
||||||
expect.triggerType = triggerType;
|
expect.triggerType = triggerType;
|
||||||
|
@ -603,15 +601,6 @@ TEST_F(ParserInitialCTest, createStream) {
|
||||||
tFreeSCMCreateStreamReq(&req);
|
tFreeSCMCreateStreamReq(&req);
|
||||||
});
|
});
|
||||||
|
|
||||||
setCreateStreamReqFunc("s1", "test", "create stream s1 as select count(*) from t1 interval(10s)");
|
|
||||||
run("CREATE STREAM s1 AS SELECT COUNT(*) FROM t1 INTERVAL(10S)");
|
|
||||||
clearCreateStreamReq();
|
|
||||||
|
|
||||||
setCreateStreamReqFunc("s1", "test", "create stream if not exists s1 as select count(*) from t1 interval(10s)",
|
|
||||||
nullptr, 1);
|
|
||||||
run("CREATE STREAM IF NOT EXISTS s1 AS SELECT COUNT(*) FROM t1 INTERVAL(10S)");
|
|
||||||
clearCreateStreamReq();
|
|
||||||
|
|
||||||
setCreateStreamReqFunc("s1", "test", "create stream s1 into st1 as select count(*) from t1 interval(10s)", "st1");
|
setCreateStreamReqFunc("s1", "test", "create stream s1 into st1 as select count(*) from t1 interval(10s)", "st1");
|
||||||
run("CREATE STREAM s1 INTO st1 AS SELECT COUNT(*) FROM t1 INTERVAL(10S)");
|
run("CREATE STREAM s1 INTO st1 AS SELECT COUNT(*) FROM t1 INTERVAL(10S)");
|
||||||
clearCreateStreamReq();
|
clearCreateStreamReq();
|
||||||
|
@ -629,7 +618,8 @@ TEST_F(ParserInitialCTest, createStream) {
|
||||||
TEST_F(ParserInitialCTest, createStreamSemanticCheck) {
|
TEST_F(ParserInitialCTest, createStreamSemanticCheck) {
|
||||||
useDb("root", "test");
|
useDb("root", "test");
|
||||||
|
|
||||||
run("CREATE STREAM s1 AS SELECT PERCENTILE(c1, 30) FROM t1 INTERVAL(10S)", TSDB_CODE_PAR_STREAM_NOT_ALLOWED_FUNC);
|
run("CREATE STREAM s1 INTO st1 AS SELECT PERCENTILE(c1, 30) FROM t1 INTERVAL(10S)",
|
||||||
|
TSDB_CODE_PAR_STREAM_NOT_ALLOWED_FUNC);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(ParserInitialCTest, createTable) {
|
TEST_F(ParserInitialCTest, createTable) {
|
||||||
|
|
|
@ -37,9 +37,9 @@ TEST_F(PlanOtherTest, createStream) {
|
||||||
TEST_F(PlanOtherTest, createStreamUseSTable) {
|
TEST_F(PlanOtherTest, createStreamUseSTable) {
|
||||||
useDb("root", "test");
|
useDb("root", "test");
|
||||||
|
|
||||||
run("CREATE STREAM IF NOT EXISTS s1 as SELECT COUNT(*) FROM st1 INTERVAL(10s)");
|
run("CREATE STREAM IF NOT EXISTS s1 into st1 as SELECT COUNT(*) FROM st1 INTERVAL(10s)");
|
||||||
|
|
||||||
run("CREATE STREAM IF NOT EXISTS s1 as SELECT COUNT(*) FROM st1 PARTITION BY TBNAME INTERVAL(10s)");
|
run("CREATE STREAM IF NOT EXISTS s1 into st1 as SELECT COUNT(*) FROM st1 PARTITION BY TBNAME INTERVAL(10s)");
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(PlanOtherTest, createSmaIndex) {
|
TEST_F(PlanOtherTest, createSmaIndex) {
|
||||||
|
|
|
@ -133,8 +133,8 @@ sql_error show grants
|
||||||
sql show queries
|
sql show queries
|
||||||
sql show connections
|
sql show connections
|
||||||
sql show apps
|
sql show apps
|
||||||
sql_error show transactions
|
sql show transactions
|
||||||
#sql_error show create database d2
|
sql_error show create database d2
|
||||||
sql show create table d2.stb2;
|
sql show create table d2.stb2;
|
||||||
sql show create table d2.ctb2;
|
sql show create table d2.ctb2;
|
||||||
sql show create table d2.ntb2;
|
sql show create table d2.ntb2;
|
||||||
|
@ -175,9 +175,8 @@ sql select * from performance_schema.perf_queries
|
||||||
sql select * from performance_schema.perf_topics
|
sql select * from performance_schema.perf_topics
|
||||||
sql select * from performance_schema.perf_consumers
|
sql select * from performance_schema.perf_consumers
|
||||||
sql select * from performance_schema.perf_subscriptions
|
sql select * from performance_schema.perf_subscriptions
|
||||||
#sql_error select * from performance_schema.perf_trans
|
sql select * from performance_schema.perf_trans
|
||||||
#sql_error select * from performance_schema.perf_smas
|
sql select * from performance_schema.perf_streams
|
||||||
#sql_error select * from information_schema.perf_streams
|
sql select * from performance_schema.perf_apps
|
||||||
#sql_error select * from information_schema.perf_apps
|
|
||||||
|
|
||||||
#system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
#system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
Loading…
Reference in New Issue