fix the issue #233, failed to record slow query
This commit is contained in:
parent
d8bc5c134d
commit
3210d9f3ca
|
@ -56,10 +56,10 @@ void tscSaveSlowQueryFp(void *handle, void *tmrId) {
|
||||||
|
|
||||||
static void *taos = NULL;
|
static void *taos = NULL;
|
||||||
if (taos == NULL) {
|
if (taos == NULL) {
|
||||||
taos = taos_connect(NULL, "sys", tsInternalPass, NULL, 0);
|
taos = taos_connect(NULL, "monitor", tsInternalPass, NULL, 0);
|
||||||
if (taos == NULL) {
|
if (taos == NULL) {
|
||||||
tscError("failed to save slow query, can't connect to server");
|
tscError("failed to save slow query, can't connect to server");
|
||||||
free(sql);
|
free(sql);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -464,13 +464,13 @@ int taosDumpOut(struct arguments *arguments) {
|
||||||
TAOS_FIELD *fields = taos_fetch_fields(result);
|
TAOS_FIELD *fields = taos_fetch_fields(result);
|
||||||
|
|
||||||
while ((row = taos_fetch_row(result)) != NULL) {
|
while ((row = taos_fetch_row(result)) != NULL) {
|
||||||
if (strncasecmp(row[TSDB_SHOW_DB_NAME_INDEX], "sys", fields[TSDB_SHOW_DB_NAME_INDEX].bytes) == 0 &&
|
if (strncasecmp(row[TSDB_SHOW_DB_NAME_INDEX], "monitor", fields[TSDB_SHOW_DB_NAME_INDEX].bytes) == 0 &&
|
||||||
(!arguments->allow_sys))
|
(!arguments->allow_sys))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (arguments->databases) {
|
if (arguments->databases) {
|
||||||
for (int i = 0; arguments->arg_list[i]; i++) {
|
for (int i = 0; arguments->arg_list[i]; i++) {
|
||||||
if (strncasecmp(arguments->arg_list[i], (char *)row[TSDB_SHOW_DB_NAME_INDEX],
|
if (strncasecmp(arguments->arg_list[i], (char *)row[TSDB_SHOW_DB_NAME_INDEX],
|
||||||
fields[TSDB_SHOW_DB_NAME_INDEX].bytes) == 0)
|
fields[TSDB_SHOW_DB_NAME_INDEX].bytes) == 0)
|
||||||
goto _dump_db_point;
|
goto _dump_db_point;
|
||||||
}
|
}
|
||||||
|
|
|
@ -433,7 +433,7 @@ int mgmtProcessAlterUserMsg(char *pMsg, int msgLen, SConnObj *pConn) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(pUser->user, "sys") == 0 || strcmp(pUser->user, "stream") == 0) {
|
if (strcmp(pUser->user, "monitor") == 0 || strcmp(pUser->user, "stream") == 0) {
|
||||||
code = TSDB_CODE_NO_RIGHTS;
|
code = TSDB_CODE_NO_RIGHTS;
|
||||||
} else if ((strcmp(pUser->user, pConn->pUser->user) == 0) ||
|
} else if ((strcmp(pUser->user, pConn->pUser->user) == 0) ||
|
||||||
((strcmp(pUser->acct, acctObj.user) == 0) && pConn->superAuth) ||
|
((strcmp(pUser->acct, acctObj.user) == 0) && pConn->superAuth) ||
|
||||||
|
@ -474,7 +474,7 @@ int mgmtProcessDropUserMsg(char *pMsg, int msgLen, SConnObj *pConn) {
|
||||||
|
|
||||||
if (strcmp(pConn->pUser->user, pDrop->user) == 0) {
|
if (strcmp(pConn->pUser->user, pDrop->user) == 0) {
|
||||||
code = TSDB_CODE_NO_RIGHTS;
|
code = TSDB_CODE_NO_RIGHTS;
|
||||||
} else if (strcmp(pDrop->user, "sys") == 0 || strcmp(pDrop->user, "stream") == 0) {
|
} else if (strcmp(pDrop->user, "monitor") == 0 || strcmp(pDrop->user, "stream") == 0) {
|
||||||
code = TSDB_CODE_NO_RIGHTS;
|
code = TSDB_CODE_NO_RIGHTS;
|
||||||
} else {
|
} else {
|
||||||
if (pConn->superAuth) {
|
if (pConn->superAuth) {
|
||||||
|
|
Loading…
Reference in New Issue