YoushouldhavereceivedacopyoftheGNUGeneralPublicLicense alongwiththisprogram;ifnot,writetotheFreeSoftware
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
int maria_rprev(MARIA_HA *info, uchar *buf, int inx)
{ int error,changed; register uint flag;
MARIA_SHARE *share= info->s;
MARIA_KEYDEF *keyinfo;
check_result_t check= CHECK_POS;
DBUG_ENTER("maria_rprev");
if ((inx = _ma_check_index(info,inx)) < 0)
DBUG_RETURN(my_errno);
flag=SEARCH_SMALLER; /* Read previous */ if (info->cur_row.lastpos == HA_OFFSET_ERROR &&
info->update & HA_STATE_NEXT_FOUND)
flag=0; /* Read last */
if (fast_ma_readinfo(info))
DBUG_RETURN(my_errno);
keyinfo= share->keyinfo + inx;
changed= _ma_test_if_changed(info); if (share->lock_key_trees)
mysql_rwlock_rdlock(&keyinfo->root_lock); if (!flag)
error= _ma_search_last(info, keyinfo, share->state.key_root[inx]); elseif (!changed)
error= _ma_search_next(info, &info->last_key,
flag | info->last_key.flag,
share->state.key_root[inx]); else
error= _ma_search(info, &info->last_key, flag | info->last_key.flag,
share->state.key_root[inx]);
if (!error)
{
my_off_t cur_keypage= info->last_keypage; while (!(*share->row_is_visible)(info) ||
((check= ma_check_index_cond(info, inx, buf)) == CHECK_NEG))
{ /* Ifweareatthelast(i.e.first?)keyonthekeypage, allowwriterstoaccesstheindex.
*/ if (info->last_keypage != cur_keypage)
{
cur_keypage= info->last_keypage; if (ma_yield_and_check_if_killed(info, inx))
{
error= 1; break;
}
}
/* Skip rows that are inserted by other threads since we got a lock */ if ((error= _ma_search_next(info, &info->last_key,
SEARCH_SMALLER,
share->state.key_root[inx]))) break;
}
} if (share->lock_key_trees)
mysql_rwlock_unlock(&keyinfo->root_lock);
info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
info->update|= HA_STATE_PREV_FOUND;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.