国产成人精品18p,天天干成人网,无码专区狠狠躁天天躁,美女脱精光隐私扒开免费观看

MySQL的非葉子節點(diǎn)指針是什么

發(fā)布時(shí)間:2021-09-14 18:07 來(lái)源:億速云 閱讀:0 作者:柒染 欄目: Mysql 歡迎投稿:712375056

本篇文章為大家展示了的非葉子節點(diǎn)指針是什么,內容簡(jiǎn)明扼要并且容易理解,絕對能使你眼前一亮,通過(guò)這篇文章的詳細介紹希望你能有所收獲。

這個(gè)指針為8字節:4(唯一定位字段個(gè)數)+4(page no)。函數為dict_index_build_node_ptr。僅此記錄,后續研究

/**********************************************************************//**
Builds a node pointer out of a physical record and a page number.
@return own: node pointer */
dtuple_t*
dict_index_build_node_ptr(
/*======================*/
    const dict_index_t*    index,    /*!< in: index */
    const rec_t*        rec,    /*!< in: record for which to build node
                    pointer */
    ulint            page_no,/*!< in: page number to put in node
                    pointer */
    mem_heap_t*        heap,    /*!< in: memory heap where pointer
                    created */
    ulint            level)    /*!< in: level of rec in tree:
                    0 means leaf level */
{
    dtuple_t*    tuple;
    dfield_t*    field;
    byte*        buf;
    ulint        n_unique;
    if (dict_index_is_ibuf(index)) {
        /* In a universal index tree, we take the whole record as
        the node pointer if the record is on the leaf level,
        on non-leaf levels we remove the last field, which
        contains the page number of the child page */
        ut_a(!dict_table_is_comp(index->table));
        n_unique = rec_get_n_fields_old(rec);
        if (level > 0) {
            ut_a(n_unique > 1);
            n_unique--;
        }
    } else {
        n_unique = dict_index_get_n_unique_in_tree_nonleaf(index);// 唯一定位 到葉子節點(diǎn)的字段個(gè)數
    }
    tuple = dtuple_create(heap, n_unique + 1); //建立元組 
    /* When searching in the tree for the node pointer, we must not do
    comparison on the last field, the page number field, as on upper
    levels in the tree there may be identical node pointers with a
    different page number; therefore, we set the n_fields_cmp to one
    less: */
    dtuple_set_n_fields_cmp(tuple, n_unique); //比較字段為 數據域
    dict_index_copy_types(tuple, index, n_unique);  //進(jìn)行類(lèi)型復制
    buf = static_cast<byte*>(mem_heap_alloc(heap, 4)); //分配內存
    mach_write_to_4(buf, page_no);//寫(xiě)入 葉子節點(diǎn)page no
    field = dtuple_get_nth_field(tuple, n_unique);  //字段個(gè)數  能夠唯一定位的字段個(gè)數
    dfield_set_data(field, buf, 4);//寫(xiě)入字段個(gè)數
    dtype_set(dfield_get_type(field), DATA_SYS_CHILD, DATA_NOT_NULL, 4);
    rec_copy_prefix_to_dtuple(tuple, rec, index, n_unique, heap); //復制數據
    dtuple_set_info_bits(tuple, dtuple_get_info_bits(tuple)
                 | REC_STATUS_NODE_PTR);
    ut_ad(dtuple_check_typed(tuple));
    return(tuple);
}

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng )、來(lái)自本網(wǎng)站內容采集于網(wǎng)絡(luò )互聯(lián)網(wǎng)轉載等其它媒體和分享為主,內容觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如侵犯了原作者的版權,請告知一經(jīng)查實(shí),將立刻刪除涉嫌侵權內容,聯(lián)系我們QQ:712375056,同時(shí)歡迎投稿傳遞力量。

永久免费AV网站| 亚洲欧洲AV无码专区| 妇女性内射冈站HDWWWOOO| 少妇的肥蝴蝶18P| 荫蒂添的好舒服视频囗交| 艳妇乳肉豪妇荡乳XXX|