patch 4.0
This commit is contained in:
@ -16,17 +16,22 @@
|
||||
|
||||
using namespace oceanbase::common;
|
||||
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
namespace oceanbase
|
||||
{
|
||||
namespace sql
|
||||
{
|
||||
|
||||
ObExprFoundRows::ObExprFoundRows(ObIAllocator& alloc)
|
||||
ObExprFoundRows::ObExprFoundRows(ObIAllocator &alloc)
|
||||
: ObFuncExprOperator(alloc, T_FUN_SYS_FOUND_ROWS, N_FOUND_ROWS, 0, NOT_ROW_DIMENSION)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
ObExprFoundRows::~ObExprFoundRows()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
int ObExprFoundRows::calc_result_type0(ObExprResType& type, common::ObExprTypeCtx& type_ctx) const
|
||||
int ObExprFoundRows::calc_result_type0(ObExprResType &type,
|
||||
common::ObExprTypeCtx &type_ctx) const
|
||||
{
|
||||
UNUSED(type_ctx);
|
||||
type.set_int();
|
||||
@ -34,25 +39,13 @@ int ObExprFoundRows::calc_result_type0(ObExprResType& type, common::ObExprTypeCt
|
||||
type.set_scale(DEFAULT_SCALE_FOR_INTEGER);
|
||||
return OB_SUCCESS;
|
||||
}
|
||||
int ObExprFoundRows::calc_result0(ObObj& result, ObExprCtx& expr_ctx) const
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
ObSQLSessionInfo* session_info = NULL;
|
||||
if (OB_ISNULL(session_info = expr_ctx.my_session_)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
SQL_ENG_LOG(WARN, "session info is null");
|
||||
} else {
|
||||
int64_t value = session_info->get_found_rows();
|
||||
result.set_int(value);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObExprFoundRows::eval_found_rows(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum)
|
||||
int ObExprFoundRows::eval_found_rows(const ObExpr &expr, ObEvalCtx &ctx,
|
||||
ObDatum &expr_datum)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
UNUSED(expr);
|
||||
const ObSQLSessionInfo* session_info = NULL;
|
||||
const ObSQLSessionInfo *session_info = NULL;
|
||||
if (OB_ISNULL(session_info = ctx.exec_ctx_.get_my_session())) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
SQL_ENG_LOG(WARN, "session info is null", K(ret));
|
||||
@ -62,12 +55,13 @@ int ObExprFoundRows::eval_found_rows(const ObExpr& expr, ObEvalCtx& ctx, ObDatum
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObExprFoundRows::cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const
|
||||
int ObExprFoundRows::cg_expr(ObExprCGCtx &op_cg_ctx, const ObRawExpr &raw_expr,
|
||||
ObExpr &rt_expr) const
|
||||
{
|
||||
UNUSED(raw_expr);
|
||||
UNUSED(op_cg_ctx);
|
||||
rt_expr.eval_func_ = ObExprFoundRows::eval_found_rows;
|
||||
return OB_SUCCESS;
|
||||
}
|
||||
} // namespace sql
|
||||
} // namespace oceanbase
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user