diff --git a/src/sql/ob_result_set.cpp b/src/sql/ob_result_set.cpp index cfba15ef2d..252eeb5f7e 100644 --- a/src/sql/ob_result_set.cpp +++ b/src/sql/ob_result_set.cpp @@ -557,7 +557,10 @@ OB_INLINE void ObResultSet::store_affected_rows(ObPhysicalPlanCtx &plan_ctx) && (lib::is_oracle_mode() || !is_pl_stmt(get_stmt_type()))) { affected_row = 0; } else if (stmt::T_SELECT == get_stmt_type()) { - affected_row = lib::is_oracle_mode() ? plan_ctx.get_affected_rows() : -1; + affected_row = plan_ctx.get_affected_rows(); + if (lib::is_mysql_mode() && 0 == affected_row) { + affected_row = -1; + } } else { affected_row = get_affected_rows(); } diff --git a/src/sql/ob_spi.cpp b/src/sql/ob_spi.cpp index c6606477a0..470805d432 100644 --- a/src/sql/ob_spi.cpp +++ b/src/sql/ob_spi.cpp @@ -6199,6 +6199,8 @@ int ObSPIService::get_result(ObPLExecCtx *ctx, true, can_retry)); OZ (query_sender->send_eof_packet(true)); + + OX(implicit_cursor->set_rowcount(into_count > 0 ? 1 : 0)); } } else if (stmt::T_ANONYMOUS_BLOCK != ob_result_set->get_stmt_type()) { // 不带Returing的INSERT,DELETE,UPDATE