YoushouldhavereceivedacopyoftheGNUGeneralPublicLicense alongwiththisprogram;ifnot,writetotheFreeSoftware
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
last_used_keyseg= keyinfo->seg + info->last_used_keyseg;
} else
{
DBUG_ASSERT(keypart_map); /* Save the packed key for later use in the second buffer of lastkey. */
_ma_pack_key(info, &key, inx, key_buff, key_data,
keypart_map, &last_used_keyseg); /* Save packed_key_length for use by the MERGE engine. */
info->pack_key_length= key.data_length;
info->last_used_keyseg= (uint16) (last_used_keyseg -
keyinfo->seg);
DBUG_EXECUTE("key", _ma_print_key(DBUG_FILE, &key););
}
if (fast_ma_readinfo(info)) goto err; if (share->lock_key_trees)
mysql_rwlock_rdlock(&keyinfo->root_lock);
nextflag= maria_read_vec[search_flag] | key.flag; if (search_flag != HA_READ_KEY_EXACT)
{ /* Assume we will get a read next/previous call after this one */
nextflag|= SEARCH_SAVE_BUFF;
} switch (keyinfo->key_alg) { case HA_KEY_ALG_RTREE: if (maria_rtree_find_first(info, &key, nextflag) < 0)
{
_ma_set_fatal_error(info, HA_ERR_CRASHED);
info->cur_row.lastpos= HA_OFFSET_ERROR;
} break; case HA_KEY_ALG_BTREE: default: if (!_ma_search(info, &key, nextflag, info->s->state.key_root[inx]))
{
MARIA_KEY lastkey; /* Foundakey,butitmightnotbeusable.Wecannotuserowsthat areinsertedbyotherthreadsafterwegotourtablelock ("concurrentinserts").Therecordmaynotevenbepresentyet. Keysareinsertedintotheindex(es)beforetherecordis insertedintothedatafile.
} while (!(*share->row_is_visible)(info) ||
((check= ma_check_index_cond(info, inx, buf)) == 0));
} else
{
DBUG_ASSERT(info->cur_row.lastpos);
}
} if (share->lock_key_trees)
mysql_rwlock_unlock(&keyinfo->root_lock);
if (info->cur_row.lastpos == HA_OFFSET_ERROR)
{ if (check == CHECK_OUT_OF_RANGE)
{ /* We don't want HA_ERR_END_OF_FILE in this particular case */
my_errno= HA_ERR_KEY_NOT_FOUND;
}
fast_ma_writeinfo(info); goto err;
}
/* Calculate length of the found key; Used by maria_rnext_same */ if ((keyinfo->flag & HA_VAR_LENGTH_KEY))
info->last_rkey_length= _ma_keylength_part(keyinfo, info->lastkey_buff,
last_used_keyseg); else
info->last_rkey_length= key.data_length;
/* Check if we don't want to have record back, only error message */ if (!buf)
{
fast_ma_writeinfo(info);
DBUG_RETURN(0);
} if (!(*info->read_record)(info, buf, info->cur_row.lastpos))
{
info->update|= HA_STATE_AKTIV; /* Record is read */
DBUG_RETURN(0);
}
err: /* Store last used key as a base for read next */
memcpy(info->last_key.data, key_buff, key.data_length);
info->last_key.data_length= key.data_length;
info->last_key.ref_length= info->s->base.rec_reflength;
info->last_key.flag= 0; /* Create key with rowid 0 */
bzero((char*) info->last_key.data + info->last_key.data_length,
info->s->base.rec_reflength);
if (search_flag == HA_READ_AFTER_KEY)
info->update|=HA_STATE_NEXT_FOUND; /* Previous gives last row */
DBUG_RETURN(my_errno);
} /* _ma_rkey */
my_bool ma_yield_and_check_if_killed(MARIA_HA *info, int inx)
{
MARIA_SHARE *share; if (ma_killed(info))
{ /* purecov: begin tested */ /* Mark that we don't have an active row */
info->cur_row.lastpos= HA_OFFSET_ERROR; /* Set error that we where aborted by kill from application */
my_errno= HA_ERR_ABORTED_BY_USER; return1; /* purecov: end */
}
if ((share= info->s)->lock_key_trees)
{ /* Give writers a chance to access index */
mysql_rwlock_unlock(&share->keyinfo[inx].root_lock);
mysql_rwlock_rdlock(&share->keyinfo[inx].root_lock);
} return0;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet am 2026-10-08)
¤
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.