YoushouldhavereceivedacopyoftheGNUGeneralPublicLicense alongwiththisprogram;ifnot,writetotheFreeSoftware
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
DBUG_EXECUTE_IF("maria_pretend_crashed_table_on_usage",
_ma_print_error(info, HA_ERR_CRASHED, 0);
DBUG_RETURN(my_errno= HA_ERR_CRASHED);); if (!(info->update & HA_STATE_AKTIV))
{
DBUG_RETURN(my_errno=HA_ERR_KEY_NOT_FOUND);
} if (share->options & HA_OPTION_READ_ONLY_DATA)
{
DBUG_RETURN(my_errno=EACCES);
} if (share->state.state.key_file_length >= share->base.margin_key_file_length)
{
DBUG_RETURN(my_errno=HA_ERR_INDEX_FILE_FULL);
}
pos= info->cur_row.lastpos; if (_ma_readinfo(info,F_WRLCK,1))
DBUG_RETURN(my_errno);
if ((*share->compare_record)(info,oldrec))
{
save_errno= my_errno;
DBUG_PRINT("warning", ("Got error from compare record")); goto err_end; /* Record has changed */
}
/* Calculate and check all unique constraints */
key_changed=0; for (i=0 ; i < share->state.header.uniques ; i++)
{
MARIA_UNIQUEDEF *def=share->uniqueinfo+i; if (_ma_unique_comp(def, newrec, oldrec,1) &&
_ma_check_unique(info, def, newrec, _ma_unique_hash(def, newrec),
pos))
{
save_errno=my_errno; goto err_end;
}
}
if (_ma_mark_file_changed(share))
{
save_errno=my_errno; goto err_end;
}
/* Ensure we don't try to restore auto_increment if it doesn't change */
info->last_auto_increment= ~(ulonglong) 0;
/* Check which keys changed from the original row */
new_key_buff= info->lastkey_buff2;
changed=0; for (i=0, keyinfo= share->keyinfo ; i < share->base.keys ; i++, keyinfo++)
{ if (maria_is_key_active(share->state.key_map, i))
{ if (keyinfo->key_alg == HA_KEY_ALG_FULLTEXT)
{ if (_ma_ft_cmp(info,i,oldrec, newrec))
{ if ((int) i == info->lastinx)
{ /* Wearechangeingtheindexwearereadingon.Markthat theindexdatahaschangedandweneedtodoafullsearch whendoingread-next
*/
key_changed|=HA_STATE_WRITTEN;
}
changed|=((ulonglong) 1 << i); if (_ma_ft_update(info,i,old_key_buff,oldrec,newrec,pos)) goto err;
}
} else
{
MARIA_KEY new_key, old_key;
if (!(*keyinfo->make_key)(info,&new_key, i, new_key_buff, newrec,
pos, info->trn->trid)) goto err;
if (!(*keyinfo->make_key)(info,&old_key, i, old_key_buff,
oldrec, pos, info->cur_row.trid))
{ /* Can'tmakeakeyfromtherecordfromthetablealready. Sholdn'thappennormally.Tableiscorrupted.
*/ goto err;
}
/* The above changed info->lastkey2. Inform maria_rnext_same(). */
info->update&= ~HA_STATE_RNEXT_SAME;
if (new_key.data_length != old_key.data_length ||
memcmp(old_key.data, new_key.data, new_key.data_length))
{ if ((int) i == info->lastinx)
key_changed|=HA_STATE_WRITTEN; /* Mark that keyfile changed */
changed|=((ulonglong) 1 << i);
keyinfo->version++; if (keyinfo->ck_delete(info,&old_key)) goto err; if (keyinfo->ck_insert(info,&new_key)) goto err; if (share->base.auto_key == i+1)
auto_key_changed=1;
}
}
}
}
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.