patch 4.0
This commit is contained in:
@ -14,21 +14,25 @@
|
||||
#include <string.h>
|
||||
#include "sql/engine/expr/ob_expr_empty_lob.h"
|
||||
#include "sql/session/ob_sql_session_info.h"
|
||||
#include "sql/parser/ob_item_type.h"
|
||||
#include "objit/common/ob_item_type.h"
|
||||
#include "lib/oblog/ob_log.h"
|
||||
|
||||
namespace oceanbase {
|
||||
namespace oceanbase
|
||||
{
|
||||
using namespace common;
|
||||
namespace sql {
|
||||
namespace sql
|
||||
{
|
||||
|
||||
// empty_clob
|
||||
ObExprEmptyClob::ObExprEmptyClob(ObIAllocator& alloc)
|
||||
ObExprEmptyClob::ObExprEmptyClob(ObIAllocator &alloc)
|
||||
: ObFuncExprOperator(alloc, T_FUN_EMPTY_CLOB, N_EMPTY_CLOB, 0, NOT_ROW_DIMENSION)
|
||||
{}
|
||||
{
|
||||
}
|
||||
ObExprEmptyClob::~ObExprEmptyClob()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
int ObExprEmptyClob::calc_result_type0(ObExprResType& type, ObExprTypeCtx& type_ctx) const
|
||||
int ObExprEmptyClob::calc_result_type0(ObExprResType &type, ObExprTypeCtx &type_ctx) const
|
||||
{
|
||||
UNUSED(type_ctx);
|
||||
ObSessionNLSParams nls_param = type_ctx.get_session()->get_session_nls_params();
|
||||
@ -38,18 +42,10 @@ int ObExprEmptyClob::calc_result_type0(ObExprResType& type, ObExprTypeCtx& type_
|
||||
return OB_SUCCESS;
|
||||
}
|
||||
|
||||
int ObExprEmptyClob::calc_result0(ObObj& result, ObExprCtx& expr_ctx) const
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
UNUSED(expr_ctx);
|
||||
|
||||
result.set_lob_value(ObLongTextType, ObString().ptr(), ObString().length());
|
||||
result.set_collation(result_type_);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObExprEmptyClob::eval_empty_clob(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum)
|
||||
int ObExprEmptyClob::eval_empty_clob(
|
||||
const ObExpr &expr,
|
||||
ObEvalCtx &ctx,
|
||||
ObDatum &expr_datum)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
UNUSED(expr);
|
||||
@ -58,7 +54,10 @@ int ObExprEmptyClob::eval_empty_clob(const ObExpr& expr, ObEvalCtx& ctx, ObDatum
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObExprEmptyClob::cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const
|
||||
int ObExprEmptyClob::cg_expr(
|
||||
ObExprCGCtx &op_cg_ctx,
|
||||
const ObRawExpr &raw_expr,
|
||||
ObExpr &rt_expr) const
|
||||
{
|
||||
UNUSED(op_cg_ctx);
|
||||
UNUSED(raw_expr);
|
||||
@ -66,14 +65,17 @@ int ObExprEmptyClob::cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr,
|
||||
return OB_SUCCESS;
|
||||
}
|
||||
|
||||
// empty_blob
|
||||
ObExprEmptyBlob::ObExprEmptyBlob(ObIAllocator& alloc)
|
||||
: ObFuncExprOperator(alloc, T_FUN_EMPTY_BLOB, N_EMPTY_BLOB, 0, NOT_ROW_DIMENSION)
|
||||
{}
|
||||
ObExprEmptyBlob::~ObExprEmptyBlob()
|
||||
{}
|
||||
|
||||
int ObExprEmptyBlob::calc_result_type0(ObExprResType& type, ObExprTypeCtx& type_ctx) const
|
||||
// empty_blob
|
||||
ObExprEmptyBlob::ObExprEmptyBlob(ObIAllocator &alloc)
|
||||
: ObFuncExprOperator(alloc, T_FUN_EMPTY_BLOB, N_EMPTY_BLOB, 0, NOT_ROW_DIMENSION)
|
||||
{
|
||||
}
|
||||
ObExprEmptyBlob::~ObExprEmptyBlob()
|
||||
{
|
||||
}
|
||||
|
||||
int ObExprEmptyBlob::calc_result_type0(ObExprResType &type, ObExprTypeCtx &type_ctx) const
|
||||
{
|
||||
UNUSED(type_ctx);
|
||||
type.set_blob();
|
||||
@ -81,18 +83,10 @@ int ObExprEmptyBlob::calc_result_type0(ObExprResType& type, ObExprTypeCtx& type_
|
||||
return OB_SUCCESS;
|
||||
}
|
||||
|
||||
int ObExprEmptyBlob::calc_result0(ObObj& result, ObExprCtx& expr_ctx) const
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
UNUSED(expr_ctx);
|
||||
|
||||
result.set_lob_value(ObLongTextType, ObString().ptr(), ObString().length());
|
||||
result.set_collation_type(CS_TYPE_BINARY);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObExprEmptyBlob::eval_empty_blob(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum)
|
||||
int ObExprEmptyBlob::eval_empty_blob(
|
||||
const ObExpr &expr,
|
||||
ObEvalCtx &ctx,
|
||||
ObDatum &expr_datum)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
UNUSED(expr);
|
||||
@ -101,7 +95,10 @@ int ObExprEmptyBlob::eval_empty_blob(const ObExpr& expr, ObEvalCtx& ctx, ObDatum
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObExprEmptyBlob::cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const
|
||||
int ObExprEmptyBlob::cg_expr(
|
||||
ObExprCGCtx &op_cg_ctx,
|
||||
const ObRawExpr &raw_expr,
|
||||
ObExpr &rt_expr) const
|
||||
{
|
||||
UNUSED(op_cg_ctx);
|
||||
UNUSED(raw_expr);
|
||||
@ -109,5 +106,5 @@ int ObExprEmptyBlob::cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr,
|
||||
return OB_SUCCESS;
|
||||
}
|
||||
|
||||
} // namespace sql
|
||||
} // namespace oceanbase
|
||||
} // end of sql
|
||||
} // end of oceanbase
|
||||
|
||||
Reference in New Issue
Block a user