mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
simplify and unify my_safe_alloca usage
This commit is contained in:
@ -1670,8 +1670,7 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
|
||||
|
||||
if (!key)
|
||||
{
|
||||
if (!(key=(char*) my_safe_alloca(table->s->max_unique_length,
|
||||
MAX_KEY_LENGTH)))
|
||||
if (!(key=(char*) my_safe_alloca(table->s->max_unique_length)))
|
||||
{
|
||||
error=ENOMEM;
|
||||
goto err;
|
||||
@ -1897,7 +1896,7 @@ after_trg_n_copied_inc:
|
||||
|
||||
ok_or_after_trg_err:
|
||||
if (key)
|
||||
my_safe_afree(key,table->s->max_unique_length,MAX_KEY_LENGTH);
|
||||
my_safe_afree(key,table->s->max_unique_length);
|
||||
if (!table->file->has_transactions())
|
||||
thd->transaction.stmt.modified_non_trans_table= TRUE;
|
||||
DBUG_RETURN(trg_error);
|
||||
@ -1909,7 +1908,7 @@ err:
|
||||
before_trg_err:
|
||||
table->file->restore_auto_increment(prev_insert_id);
|
||||
if (key)
|
||||
my_safe_afree(key, table->s->max_unique_length, MAX_KEY_LENGTH);
|
||||
my_safe_afree(key, table->s->max_unique_length);
|
||||
table->column_bitmaps_set(save_read_set, save_write_set);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user