• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ OB_ASSERT函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中OB_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ OB_ASSERT函数的具体用法?C++ OB_ASSERT怎么用?C++ OB_ASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了OB_ASSERT函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ob_dec_phy_operator_stat

 void ob_dec_phy_operator_stat(ObPhyOperatorType type)
 {
   OB_ASSERT(type >= PHY_INVALID && type < PHY_END);
   TBSYS_LOG(DEBUG, "ob_dec_phy_operator_stat %s num=%lu",
       ob_phy_operator_type_str(type), PHY_OP_STAT[type]);
   atomic_dec(&PHY_OP_STAT[type]);
 }
开发者ID:Alibaba-boonya,项目名称:oceanbase,代码行数:7,代码来源:ob_phy_operator_type.cpp


示例2: OB_ASSERT

 int ObStatManager::set_value(const uint64_t mod_id, const uint64_t table_id, const int32_t index, const int64_t value)
 {
   int ret = OB_ERROR;
   bool need_add_new = true;
   OB_ASSERT(mod_id < OB_MAX_MOD_NUMBER);
   for (int32_t i = 0; table_id != OB_INVALID_ID && mod_id != OB_INVALID_ID && i < table_stats_[mod_id].get_array_index(); i++)
   {
     if (data_holder_[mod_id][i].get_table_id() == table_id)
     {
       need_add_new = false;
       ret = data_holder_[mod_id][i].set_value(index, value);
     }
   }
   if (need_add_new && table_id != OB_INVALID_ID && mod_id != OB_INVALID_ID)
   {
     ObStat stat;
     stat.set_mod_id(mod_id);
     stat.set_table_id(table_id);
     ret = stat.set_value(index, value);
     if (OB_SUCCESS == ret)
     {
       if ((ret = add_new_stat(stat)) == OB_ENTRY_EXIST)
       {
         ret = set_value(mod_id, table_id, index, value);
       }
     }
   }
   return ret;
 }
开发者ID:Alibaba-boonya,项目名称:oceanbase,代码行数:29,代码来源:ob_statistics.cpp


示例3: OB_ASSERT

        /**************************************************
        Funtion     :   make_exec_plan_unit_string
        Author      :   qinbo
        Date        :   2013.12.9
        Description :   make select sql
        Input       :   ResultPlan& result_plan, 
                        string &where_conditions, 
                        vector<schema_shard*> shard_info,
                        string &assembled_sql
                        
        Output      :   
         **************************************************/
        int64_t ObDeleteStmt::make_exec_plan_unit_string(ResultPlan& result_plan, string where_conditions, vector<schema_shard*> &shard_info,string &assembled_sql)
        {
            int& ret = result_plan.err_stat_.err_code_ = OB_SUCCESS;
            ObLogicalPlan* logical_plan = static_cast<ObLogicalPlan*> (result_plan.plan_tree_);
            OB_ASSERT(NULL != logical_plan);

            assembled_sql.append("DELETE FROM ");
            string table_name = ObStmt::get_table_item_by_id(table_id_)->table_name_ ;
            if (table_name != shard_info.at(0)->get_table_name())
            {
                assembled_sql.append(shard_info.at(0)->get_shard_name());
            }
            else
            {
                assembled_sql.append(table_name);
            }

            if (where_conditions.empty())
            {
                make_delete_where_string(result_plan, assembled_sql);
            }
            else
            {
                assembled_sql.append(where_conditions);
                assembled_sql.append(" ");
            }
            return ret;
        }
开发者ID:taotaochanghe,项目名称:sql_parser,代码行数:40,代码来源:sql_delete_stmt.cpp


示例4: mtime_bool

 static int mtime_bool(const ObObjCastParams &params, const ObExprObj &in, ObExprObj &out)
 {
     UNUSED(params);
     OB_ASSERT(in.get_type() == ObModifyTimeType);
     out.set_bool(static_cast<bool> (in.get_mtime()));
     return OB_SUCCESS;
 }
开发者ID:b-xiang,项目名称:sql_parser-1,代码行数:7,代码来源:ob_obj_cast.cpp


示例5: ctime_float

 static int ctime_float(const ObObjCastParams &params, const ObExprObj &in, ObExprObj &out)
 {
     UNUSED(params);
     OB_ASSERT(in.get_type() == ObCreateTimeType);
     out.set_float(static_cast<float> (in.get_ctime()));
     return OB_SUCCESS;
 }
开发者ID:b-xiang,项目名称:sql_parser-1,代码行数:7,代码来源:ob_obj_cast.cpp


示例6: bool_ctime

 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;
 }
开发者ID:b-xiang,项目名称:sql_parser-1,代码行数:7,代码来源:ob_obj_cast.cpp


示例7: mtime_pdatetime

 static int mtime_pdatetime(const ObObjCastParams &params, const ObExprObj &in, ObExprObj &out)
 {
     UNUSED(params);
     OB_ASSERT(in.get_type() == ObModifyTimeType);
     out.set_precise_datetime(static_cast<ObPreciseDateTime> (in.get_mtime()));
     return OB_SUCCESS;
 }
开发者ID:b-xiang,项目名称:sql_parser-1,代码行数:7,代码来源:ob_obj_cast.cpp


示例8: ctime_datetime

 static int ctime_datetime(const ObObjCastParams &params, const ObExprObj &in, ObExprObj &out)
 {
     UNUSED(params);
     OB_ASSERT(in.get_type() == ObCreateTimeType);
     out.set_datetime(static_cast<ObDateTime> (in.get_ctime() / 1000000L));
     return OB_SUCCESS;
 }
开发者ID:b-xiang,项目名称:sql_parser-1,代码行数:7,代码来源:ob_obj_cast.cpp


示例9: double_int

 static int double_int(const ObObjCastParams &params, const ObExprObj &in, ObExprObj &out)
 {
     UNUSED(params);
     OB_ASSERT(in.get_type() == ObDoubleType);
     out.set_int(static_cast<int64_t> (in.get_double()));
     return OB_SUCCESS;
 }
开发者ID:b-xiang,项目名称:sql_parser-1,代码行数:7,代码来源:ob_obj_cast.cpp


示例10: double_mtime

 static int double_mtime(const ObObjCastParams &params, const ObExprObj &in, ObExprObj &out)
 {
     UNUSED(params);
     OB_ASSERT(in.get_type() == ObDoubleType);
     out.set_mtime(static_cast<ObModifyTime> (in.get_double()));
     return OB_SUCCESS;
 }
开发者ID:b-xiang,项目名称:sql_parser-1,代码行数:7,代码来源:ob_obj_cast.cpp


示例11: decimal_bool

 static int decimal_bool(const ObObjCastParams &params, const ObExprObj &in, ObExprObj &out)
 {
     UNUSED(params);
     OB_ASSERT(in.get_type() == ObDecimalType);
     out.set_bool(!in.get_decimal().is_zero());
     return OB_SUCCESS;
 }
开发者ID:b-xiang,项目名称:sql_parser-1,代码行数:7,代码来源:ob_obj_cast.cpp


示例12: float_double

 static int float_double(const ObObjCastParams &params, const ObExprObj &in, ObExprObj &out)
 {
     UNUSED(params);
     OB_ASSERT(in.get_type() == ObFloatType);
     out.set_double(static_cast<double> (in.get_float()));
     return OB_SUCCESS;
 }
开发者ID:b-xiang,项目名称:sql_parser-1,代码行数:7,代码来源:ob_obj_cast.cpp


示例13: int_datetime

 static int int_datetime(const ObObjCastParams &params, const ObExprObj &in, ObExprObj &out)
 {
     UNUSED(params);
     OB_ASSERT(in.get_type() == ObIntType);
     out.set_datetime(static_cast<ObDateTime> (in.get_int()));
     return OB_SUCCESS;
 }
开发者ID:b-xiang,项目名称:sql_parser-1,代码行数:7,代码来源:ob_obj_cast.cpp


示例14: bool_float

 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;
 }
开发者ID:b-xiang,项目名称:sql_parser-1,代码行数:7,代码来源:ob_obj_cast.cpp


示例15: int_varchar

 static int int_varchar(const ObObjCastParams &params, const ObExprObj &in, ObExprObj &out)
 {
     int ret = OB_SUCCESS;
     UNUSED(params);
     OB_ASSERT(in.get_type() == ObIntType);
     ret = varchar_printf(out, "%ld", in.get_int());
     return ret;
 }
开发者ID:b-xiang,项目名称:sql_parser-1,代码行数:8,代码来源:ob_obj_cast.cpp


示例16: int_decimal

 static int int_decimal(const ObObjCastParams &params, const ObExprObj &in, ObExprObj &out)
 {
     UNUSED(params);
     OB_ASSERT(in.get_type() == ObIntType);
     ObNumber num;
     num.from(in.get_int());
     out.set_decimal(num); // @todo optimize
     return OB_SUCCESS;
 }
开发者ID:b-xiang,项目名称:sql_parser-1,代码行数:9,代码来源:ob_obj_cast.cpp


示例17: mtime_decimal

 static int mtime_decimal(const ObObjCastParams &params, const ObExprObj &in, ObExprObj &out)
 {
     UNUSED(params);
     OB_ASSERT(in.get_type() == ObModifyTimeType);
     ObNumber num;
     num.from(static_cast<int64_t> (in.get_mtime()));
     out.set_decimal(num);
     return OB_SUCCESS;
 }
开发者ID:b-xiang,项目名称:sql_parser-1,代码行数:9,代码来源:ob_obj_cast.cpp


示例18: datetime_varchar

 static int datetime_varchar(const ObObjCastParams &params, const ObExprObj &in, ObExprObj &out)
 {
     int ret = OB_SUCCESS;
     UNUSED(params);
     OB_ASSERT(in.get_type() == ObDateTimeType);
     time_t t = static_cast<time_t> (in.get_datetime());
     struct tm gtm;
     localtime_r(&t, &gtm);
     ret = varchar_printf(out, "%04d-%02d-%02d %02d:%02d:%02d",
             gtm.tm_year + 1900, gtm.tm_mon + 1, gtm.tm_mday,
             gtm.tm_hour, gtm.tm_min, gtm.tm_sec);
     return ret;
 }
开发者ID:b-xiang,项目名称:sql_parser-1,代码行数:13,代码来源:ob_obj_cast.cpp


示例19: varchar_datetime

 static int varchar_datetime(const ObObjCastParams &params, const ObExprObj &in, ObExprObj &out)
 {
     int ret = OB_SUCCESS;
     UNUSED(params);
     OB_ASSERT(in.get_type() == ObVarcharType);
     int year = 0;
     int month = 0;
     int day = 0;
     int hour = 0;
     int minute = 0;
     int second = 0;
     ret = varchar_scanf(in, 6, "%4d-%2d-%2d %2d:%2d:%2d",
             &year, &month, &day,
             &hour, &minute, &second);
     if (OB_SUCCESS != ret)
     {
         year = month = day = hour = minute = second = 0;
         ret = varchar_scanf(in, 3, "%4d-%2d-%2d",
                 &year, &month, &day);
     }
     if (OB_SUCCESS != ret)
     {
         year = month = day = hour = minute = second = 0;
         ret = varchar_scanf(in, 3, "%2d:%2d:%2d",
                 &hour, &minute, &second);
     }
     if (OB_SUCCESS == ret)
     {
         struct tm gtm;
         memset(&gtm, 0, sizeof (gtm));
         gtm.tm_year = year - 1900;
         gtm.tm_mon = month - 1;
         gtm.tm_mday = day;
         gtm.tm_hour = hour;
         gtm.tm_min = minute;
         gtm.tm_sec = second;
         time_t t = mktime(&gtm);
         out.set_datetime(static_cast<ObDateTime> (t));
     }
     else
     {
         const string& varchar = in.get_varchar();
         jlog(WARNING, "failed to convert string `%.*s' to datetime type",
                 varchar.length(), varchar.data());
         out.set_datetime(static_cast<ObDateTime> (0));
         ret = OB_SUCCESS;
     }
     return ret;
 }
开发者ID:b-xiang,项目名称:sql_parser-1,代码行数:49,代码来源:ob_obj_cast.cpp


示例20: bool_varchar

 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;
 }
开发者ID:b-xiang,项目名称:sql_parser-1,代码行数:16,代码来源:ob_obj_cast.cpp



注:本文中的OB_ASSERT函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ OCDoResource函数代码示例发布时间:2022-05-30
下一篇:
C++ OBJ_txt2nid函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap