fix weak read bug for query contain for update

This commit is contained in:
obdev
2023-02-07 10:53:24 +08:00
committed by ob-robot
parent 3092d25f78
commit 13bcd47b9a

View File

@ -1314,10 +1314,11 @@ int ObTableLocation::get_is_weak_read(const ObDMLStmt &dml_stmt,
{
int ret = OB_SUCCESS;
is_weak_read = false;
if (OB_ISNULL(session) || OB_ISNULL(sql_ctx)) {
if (OB_ISNULL(session) || OB_ISNULL(sql_ctx) || OB_ISNULL(dml_stmt.get_query_ctx())) {
ret = OB_ERR_UNEXPECTED;
LOG_ERROR("unexpected null", K(ret), K(session), K(sql_ctx));
} else if (dml_stmt.get_query_ctx()->has_dml_write_stmt_) {
} else if (dml_stmt.get_query_ctx()->has_dml_write_stmt_ ||
dml_stmt.get_query_ctx()->is_contain_select_for_update_) {
is_weak_read = false;
} else {
ObConsistencyLevel consistency_level = INVALID_CONSISTENCY;