Logo Search packages:      
Sourcecode: maxdb-7.5.00 version File versions  Download package

void cbd500_Tree::bd500NextNode (  ) 

function: bd500NextNode description: The internal node is set to the right neighbor node.

The PathInfo of current level is updated and of the above levels, if possible. If right neighbor is nil and current node is an index-node and LeftMostIdNextLowerLevel is not nil, then the next node is set to this node. If the stop condition (StopKey) is reached, then the internal node is released and no further Next-Operation is possible.

Definition at line 310 of file vbd500.cpp.

References cbd600_Node::bd600GetNode(), cbd600_Node::bd600IsAccessable(), cbd600_Node::bd600IsLeaf(), cbd600_Node::bd600LeafCount(), cbd600_Node::bd600MaxRecIndex(), cbd600_Node::bd600Move(), cbd600_Node::bd600Release(), cbd600_Node::m_Current, and cbd600_Node::m_pNode.

Referenced by cbd400_InvTree::bd400DropTreeKeepLeaves().

{
    ROUTINE_DBG_MEO00 ("bd500NextNode");

    if ( // PTS 1103703 AK 30-08-1999 
        (m_Node.m_Current.curr_trans->trRteCommPtr_gg00->to_cancel) &&    
        (
        (m_select == m_Node.m_Current.curr_action) ||
        (m_verify == m_Node.m_Current.curr_action)
        )
       )                     
    {
        m_TrError = e_cancelled;
        g01opmsg (sp3p_knldiag, sp3m_info, csp3_bd_msg, csp3_n_btree,
              "BD500: Next cancelled   " , m_Node.m_Current.curr_trans->trTaskId_gg00);
        return;
    }

    if ( ! m_Node.bd600IsAccessable() ) return;

    if ( NIL_PAGE_NO_GG00 != m_Node.m_pNode->nd_right() )
    {
        m_PathInfo[m_CurrLevel].piLeftId_bd500 = m_Node.m_pNode->nd_id();
        m_Node.bd600Move ( m_Node.m_pNode->nd_right() );
        if ( e_ok != m_TrError ) return;
        m_PathInfo[m_CurrLevel].piSubNodeRecIndex_bd500 = FIRST_REC_INDEX_BD00;
        m_PathInfo[m_CurrLevel].piMaxRecIndex_bd500     = m_Node.bd600MaxRecIndex();
        m_PathInfo[m_CurrLevel].piLeafCount_bd500       = m_Node.bd600LeafCount(FIRST_REC_INDEX_BD00,FIRST_REC_INDEX_BD00);
    }
    else
    {
        if ( m_Node.bd600IsLeaf() )
        {
            m_Node.bd600Release (IS_CHANGED_BD600);
            return;
        }
        else
            m_Node.bd600Release (IS_CHANGED_BD600);

        if ( NIL_PAGE_NO_GG00 != m_LeftMostIdNextLowerLevel )
        {
            m_Node.bd600GetNode (m_LeftMostIdNextLowerLevel);

#           if COMPILEMODE_MEO00 >= SLOW_MEO00 
            t01int4 (bd_index, "ToLeftMostId", m_LeftMostIdNextLowerLevel);
#           endif

            if ( e_ok == m_TrError )
            {
                bd510_SetLeftMostIdNextLowerLevel (m_Node.m_pNode);
#               if COMPILEMODE_MEO00 >= SLOW_MEO00 
                t01int4 (bd_index, "NewLeftMstID", m_LeftMostIdNextLowerLevel);
#               endif
            }
        }
    }

    if ( ! m_Node.bd600IsAccessable() || e_ok != m_TrError ) return;

    bd500_CheckStopKeyAndInterrupt (ASCENDING_GBD500);
}


Generated by  Doxygen 1.6.0   Back to index