summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-03-07 09:26:50 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2022-03-07 09:26:50 +0200
commit2dce3bad9c7e715f4c0beb811ad359ce8fe67bf0 (patch)
tree8595767031e7bb7df06c27f64a2cf2d5fb508fc8 /sql
parente8e755ea6cbac56d561375b940281a903c7db61c (diff)
parent7b97020d402ae96b1da84396c172bdfdc1bccb37 (diff)
downloadmariadb-git-2dce3bad9c7e715f4c0beb811ad359ce8fe67bf0.tar.gz
Merge 10.4 into 10.5
Diffstat (limited to 'sql')
-rw-r--r--sql/item_func.cc12
-rw-r--r--sql/sql_table.cc10
2 files changed, 10 insertions, 12 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 452bc74cc82..5fb3efc27d5 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -3484,6 +3484,7 @@ udf_handler::fix_fields(THD *thd, Item_func_or_sum *func,
thd->alloc(f_args.arg_count*sizeof(Item_result))))
{
+ err_exit:
free_udf(u_d);
DBUG_RETURN(TRUE);
}
@@ -3523,7 +3524,8 @@ udf_handler::fix_fields(THD *thd, Item_func_or_sum *func,
func->used_tables_and_const_cache_join(item);
f_args.arg_type[i]=item->result_type();
}
- if (!(buffers=new (thd->mem_root) String[arg_count]) ||
+ buffers=new (thd->mem_root) String[arg_count];
+ if (!buffers ||
!multi_alloc_root(thd->mem_root,
&f_args.args, arg_count * sizeof(char *),
&f_args.lengths, arg_count * sizeof(long),
@@ -3532,10 +3534,7 @@ udf_handler::fix_fields(THD *thd, Item_func_or_sum *func,
&f_args.attributes, arg_count * sizeof(char *),
&f_args.attribute_lengths, arg_count * sizeof(long),
NullS))
- {
- free_udf(u_d);
- DBUG_RETURN(TRUE);
- }
+ goto err_exit;
}
if (func->fix_length_and_dec())
DBUG_RETURN(TRUE);
@@ -3603,8 +3602,7 @@ udf_handler::fix_fields(THD *thd, Item_func_or_sum *func,
{
my_error(ER_CANT_INITIALIZE_UDF, MYF(0),
u_d->name.str, init_msg_buff);
- free_udf(u_d);
- DBUG_RETURN(TRUE);
+ goto err_exit;
}
func->max_length=MY_MIN(initid.max_length,MAX_BLOB_WIDTH);
func->maybe_null=initid.maybe_null;
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 129b96971ff..1d74a2fc25e 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -8012,16 +8012,15 @@ static bool mysql_inplace_alter_table(THD *thd,
lock for prepare phase under LOCK TABLES in the same way as when
exclusive lock is required for duration of the whole statement.
*/
- if (!ha_alter_info->mdl_exclusive_after_prepare &&
- (inplace_supported == HA_ALTER_INPLACE_EXCLUSIVE_LOCK ||
- ((inplace_supported == HA_ALTER_INPLACE_COPY_NO_LOCK ||
+ if (inplace_supported == HA_ALTER_INPLACE_EXCLUSIVE_LOCK ||
+ ((inplace_supported == HA_ALTER_INPLACE_COPY_NO_LOCK ||
inplace_supported == HA_ALTER_INPLACE_COPY_LOCK ||
inplace_supported == HA_ALTER_INPLACE_NOCOPY_NO_LOCK ||
inplace_supported == HA_ALTER_INPLACE_NOCOPY_LOCK ||
inplace_supported == HA_ALTER_INPLACE_INSTANT) &&
(thd->locked_tables_mode == LTM_LOCK_TABLES ||
thd->locked_tables_mode == LTM_PRELOCKED_UNDER_LOCK_TABLES)) ||
- alter_info->requested_lock == Alter_info::ALTER_TABLE_LOCK_EXCLUSIVE))
+ alter_info->requested_lock == Alter_info::ALTER_TABLE_LOCK_EXCLUSIVE)
{
if (wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN))
goto cleanup;
@@ -8116,7 +8115,8 @@ static bool mysql_inplace_alter_table(THD *thd,
necessary only for prepare phase (unless we are not under LOCK TABLES) and
user has not explicitly requested exclusive lock.
*/
- if ((inplace_supported == HA_ALTER_INPLACE_COPY_NO_LOCK ||
+ if (!ha_alter_info->mdl_exclusive_after_prepare &&
+ (inplace_supported == HA_ALTER_INPLACE_COPY_NO_LOCK ||
inplace_supported == HA_ALTER_INPLACE_COPY_LOCK ||
inplace_supported == HA_ALTER_INPLACE_NOCOPY_LOCK ||
inplace_supported == HA_ALTER_INPLACE_NOCOPY_NO_LOCK) &&