Exemplo n.º 1
0
 static int bool_ctime(const ObObjCastParams &params, const ObExprObj &in, ObExprObj &out)
 {
     UNUSED(params);
     OB_ASSERT(in.get_type() == ObBoolType);
     out.set_ctime(static_cast<ObCreateTime> (in.get_bool()));
     return OB_SUCCESS;
 }
Exemplo n.º 2
0
 static int bool_float(const ObObjCastParams &params, const ObExprObj &in, ObExprObj &out)
 {
     UNUSED(params);
     OB_ASSERT(in.get_type() == ObBoolType);
     out.set_float(static_cast<float> (in.get_bool()));
     return OB_SUCCESS;
 }
Exemplo n.º 3
0
 static int bool_decimal(const ObObjCastParams &params, const ObExprObj &in, ObExprObj &out)
 {
     UNUSED(params);
     OB_ASSERT(in.get_type() == ObBoolType);
     ObNumber num;
     num.from(static_cast<int64_t> (in.get_bool()));
     out.set_decimal(num);
     return OB_SUCCESS;
 }
Exemplo n.º 4
0
 static int bool_varchar(const ObObjCastParams &params, const ObExprObj &in, ObExprObj &out)
 {
     UNUSED(params);
     OB_ASSERT(in.get_type() == ObBoolType);
     string varchar;
     if (in.get_bool())
     {
         varchar.assign("true");
     }
     else
     {
         varchar.assign("false");
     }
     out.set_varchar(varchar);
     return OB_SUCCESS;
 }