fix/wal_level 0: error with wal_level 0 to replica > 1
This commit is contained in:
parent
d6b2bcba68
commit
fdc2de2bd0
|
@ -7267,6 +7267,15 @@ static void buildAlterDbReq(STranslateContext* pCxt, SAlterDatabaseStmt* pStmt,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t translateAlterDatabase(STranslateContext* pCxt, SAlterDatabaseStmt* pStmt) {
|
static int32_t translateAlterDatabase(STranslateContext* pCxt, SAlterDatabaseStmt* pStmt) {
|
||||||
|
if (pStmt->pOptions->walLevel == 0) {
|
||||||
|
SDbCfgInfo dbCfg = {0};
|
||||||
|
int32_t code = getDBCfg(pCxt, pStmt->dbName, &dbCfg);
|
||||||
|
if (TSDB_CODE_SUCCESS == code && dbCfg.replications > 1) {
|
||||||
|
return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_DB_OPTION,
|
||||||
|
"Invalid option, wal_level 0 should be used with replica 1");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int32_t code = checkDatabaseOptions(pCxt, pStmt->dbName, pStmt->pOptions);
|
int32_t code = checkDatabaseOptions(pCxt, pStmt->dbName, pStmt->pOptions);
|
||||||
if (TSDB_CODE_SUCCESS != code) {
|
if (TSDB_CODE_SUCCESS != code) {
|
||||||
return code;
|
return code;
|
||||||
|
|
Loading…
Reference in New Issue