PHYSICAL RECORD

 

 

 

 

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ulint* rec_get_offsets_func( /*=================*/ const rec_t* rec, /*!< in: physical record */ const dict_index_t* index, /*!< in: record descriptor */ ulint* offsets,/*!< in/out: array consisting of offsets[0] allocated elements, or an array from rec_get_offsets(), or NULL */ ulint n_fields,/*!< in: maximum number of initialized fields (ULINT_UNDEFINED if all fields) */ #ifdef UNIV_DEBUG const char* file, /*!< in: file name where called */ ulint line, /*!< in: line number where called */ #endif /* UNIV_DEBUG */ mem_heap_t** heap) /*!< in/out: memory heap */ { ulint n; ulint size; ut_ad(rec); ut_ad(index); ut_ad(heap); if (dict_table_is_comp(index->table)) { switch (UNIV_EXPECT(rec_get_status(rec), REC_STATUS_ORDINARY)) { case REC_STATUS_ORDINARY: n = dict_index_get_n_fields(index); break; case REC_STATUS_NODE_PTR: /* Node pointer records consist of the uniquely identifying fields of the record followed by a child page number field. */ n = dict_index_get_n_unique_in_tree_nonleaf(index) + 1; break; case REC_STATUS_INFIMUM: case REC_STATUS_SUPREMUM: /* infimum or supremum record */ n = 1; break; default: ut_error; return(NULL); } } else { n = rec_get_n_fields_old(rec); } if (UNIV_UNLIKELY(n_fields < n)) { n = n_fields; } /* The offsets header consists of the allocation size at offsets[0] and the REC_OFFS_HEADER_SIZE bytes. */ size = n + (1 + REC_OFFS_HEADER_SIZE); if (UNIV_UNLIKELY(!offsets) || UNIV_UNLIKELY(rec_offs_get_n_alloc(offsets) < size)) { if (UNIV_UNLIKELY(!*heap)) { *heap = mem_heap_create_at(size * sizeof(ulint), file, line); } offsets = static_cast<ulint*>( mem_heap_alloc(*heap, size * sizeof(ulint))); rec_offs_set_n_alloc(offsets, size); } rec_offs_set_n_fields(offsets, n); rec_init_offsets(rec, index, offsets); return(offsets); }帮我以注释的形式解释下这段代码吧
最新发布
06-03

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值