ha_innobase::rnd_next

/*****************************************************************//**
Reads the next row in a table scan (also used to read the FIRST row
in a table scan).
@return    0, HA_ERR_END_OF_FILE, or error number */
UNIV_INTERN
int
ha_innobase::rnd_next(
/*==================*/
    uchar*    buf)    /*!< in/out: returns the row in this buffer,
            in MySQL format */
{
    int    error;

    DBUG_ENTER("rnd_next");
    ha_statistic_increment(&SSV::ha_read_rnd_next_count);

    if (start_of_scan) {
        error = index_first(buf);

        if (error == HA_ERR_KEY_NOT_FOUND) {
            error = HA_ERR_END_OF_FILE;
        }

        start_of_scan = 0;
    } else {
        error = general_fetch(buf, ROW_SEL_NEXT, 0);
    }

    DBUG_RETURN(error);
}
原文地址:https://www.cnblogs.com/taek/p/5040580.html