create table
This commit is contained in:
parent
956aa1742c
commit
162066235b
|
@ -107,6 +107,7 @@ extern bool tsMonitorComp;
|
|||
extern bool tsEnableAudit;
|
||||
extern char tsAuditFqdn[];
|
||||
extern uint16_t tsAuditPort;
|
||||
extern bool tsEnableAuditCreateTable;
|
||||
|
||||
// telem
|
||||
extern bool tsEnableTelem;
|
||||
|
|
|
@ -101,6 +101,9 @@
|
|||
# enable/disable audit log
|
||||
# audit 1
|
||||
|
||||
# enable/disable audit create table
|
||||
# auditCreateTable 1
|
||||
|
||||
# The following parameter is used to limit the maximum number of lines in log files.
|
||||
# max number of lines per log filters
|
||||
# numOfLogLines 10000000
|
||||
|
|
|
@ -101,6 +101,7 @@ bool tsMonitorComp = false;
|
|||
bool tsEnableAudit = true;
|
||||
char tsAuditFqdn[TSDB_FQDN_LEN] = {0};
|
||||
uint16_t tsAuditPort = 6043;
|
||||
bool tsEnableAuditCreateTable = true;
|
||||
|
||||
// telem
|
||||
bool tsEnableTelem = true;
|
||||
|
@ -632,6 +633,7 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
|
|||
if (cfgAddBool(pCfg, "audit", tsEnableAudit, CFG_SCOPE_SERVER) != 0) return -1;
|
||||
if (cfgAddString(pCfg, "auditFqdn", tsAuditFqdn, CFG_SCOPE_SERVER) != 0) return -1;
|
||||
if (cfgAddInt32(pCfg, "auditPort", tsAuditPort, 1, 65056, CFG_SCOPE_SERVER) != 0) return -1;
|
||||
if (cfgAddBool(pCfg, "auditCreateTable", tsEnableAuditCreateTable, CFG_SCOPE_SERVER) != 0) return -1;
|
||||
|
||||
if (cfgAddBool(pCfg, "crashReporting", tsEnableCrashReport, CFG_SCOPE_BOTH) != 0) return -1;
|
||||
if (cfgAddBool(pCfg, "telemetryReporting", tsEnableTelem, CFG_SCOPE_BOTH) != 0) return -1;
|
||||
|
@ -1050,6 +1052,7 @@ static int32_t taosSetServerCfg(SConfig *pCfg) {
|
|||
tsEnableAudit = cfgGetItem(pCfg, "audit")->bval;
|
||||
tstrncpy(tsAuditFqdn, cfgGetItem(pCfg, "auditFqdn")->str, TSDB_FQDN_LEN);
|
||||
tsAuditPort = (uint16_t)cfgGetItem(pCfg, "auditPort")->i32;
|
||||
tsEnableAuditCreateTable = cfgGetItem(pCfg, "auditCreateTable")->bval;
|
||||
|
||||
tsEnableTelem = cfgGetItem(pCfg, "telemetryReporting")->bval;
|
||||
tsEnableCrashReport = cfgGetItem(pCfg, "crashReporting")->bval;
|
||||
|
|
|
@ -947,13 +947,13 @@ static int32_t vnodeProcessCreateTbReq(SVnode *pVnode, int64_t ver, void *pReq,
|
|||
|
||||
taosArrayPush(rsp.pArray, &cRsp);
|
||||
|
||||
if(pCreateReq->sqlLen > 0){ //skip auto create table, not set sql when auto create table
|
||||
if(tsEnableAuditCreateTable){
|
||||
int32_t clusterId = pVnode->config.syncCfg.nodeInfo[0].clusterId;
|
||||
|
||||
SName name = {0};
|
||||
tNameFromString(&name, pVnode->config.dbname, T_NAME_ACCT | T_NAME_DB);
|
||||
|
||||
auditRecord(pReq, clusterId, "createTable", name.dbname, pCreateReq->name, pCreateReq->sql, pCreateReq->sqlLen);
|
||||
auditRecord(pReq, clusterId, "createTable", name.dbname, "", pCreateReq->name, strlen(pCreateReq->name));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue