diff --git a/src/mnode/src/mnodeDb.c b/src/mnode/src/mnodeDb.c index 322db568d08eeea991630a38f47cfe91fa468f7d..f7c4ceb0550a18e1366ee2ebae5537dfc994d86e 100644 --- a/src/mnode/src/mnodeDb.c +++ b/src/mnode/src/mnodeDb.c @@ -1013,7 +1013,7 @@ static SDbCfg mnodeGetAlterDbOption(SDbObj *pDb, SAlterDbMsg *pAlter) { newCfg.daysToKeep2 = daysToKeep2; } - if (minRows > 0 && minRows != pDb->cfg.minRowsPerFileBlock) { + if (minRows >= 0 && minRows != pDb->cfg.minRowsPerFileBlock) { mDebug("db:%s, minRows:%d change to %d", pDb->name, pDb->cfg.minRowsPerFileBlock, minRows); newCfg.minRowsPerFileBlock = minRows; } diff --git a/tests/script/general/db/alter_option.sim b/tests/script/general/db/alter_option.sim index ec9c391db5eb0fbd4eb51641e864024ced9a77d1..813af583795d91241a89daaff40fe8e438725344 100644 --- a/tests/script/general/db/alter_option.sim +++ b/tests/script/general/db/alter_option.sim @@ -182,7 +182,11 @@ sql_error alter database db blocks -1 sql_error alter database db blocks 10001 print ============== step minrows +sql_error alter database db minrows 0 sql_error alter database db minrows 1 +sql_error alter database db minrows -1 +sql_error alter database db minrows 9 +sql_error alter database db minrows 1001 sql alter database db minrows 100 sql alter database db minrows 1000