add for the standby database to intercept write stmt

This commit is contained in:
obdev
2022-11-15 10:08:11 +00:00
committed by wangzelin.wzl
parent b29a1bfe75
commit 7e87122d06
5 changed files with 40 additions and 25 deletions

View File

@ -1053,6 +1053,14 @@ int ObResolver::resolve(IsPrepared if_prepared, const ParseNode &parse_tree, ObS
}
} // end switch
if (OB_SUCC(ret)) {
if (ObStmt::is_write_stmt(stmt->get_stmt_type(), stmt->has_global_variable())
&& !MTL_IS_PRIMARY_TENANT()) {
ret = OB_STANDBY_READ_ONLY;
TRANS_LOG(WARN, "standby tenant support read only", K(ret), K(stmt));
}
}
if (OB_SUCC(ret) && stmt->is_dml_write_stmt()) {
// todo yanli:检查主备库
}