summaryrefslogtreecommitdiff
path: root/sql/sql_udf.cc
diff options
context:
space:
mode:
authorGalina Shalygina <galina.shalygina@mariadb.com>2018-06-01 21:57:10 +0200
committerGalina Shalygina <galina.shalygina@mariadb.com>2018-06-01 21:57:10 +0200
commit6db465d7ce455cf75ec224108cbe61ca8be63d3d (patch)
tree9648ff1fc677eebb60b278c2e2c13131934ed2a0 /sql/sql_udf.cc
parentffe83e8e7bef32eb2a80aad2d382f0b023dd3a44 (diff)
parent4a49f7f88cfa82ae6eb8e7b5a528e91416b33b52 (diff)
downloadmariadb-git-shagalla-10.4.tar.gz
Merge 10.3.7 into 10.4shagalla-10.4
Diffstat (limited to 'sql/sql_udf.cc')
-rw-r--r--sql/sql_udf.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc
index 3eb50d45b42..9a036156de6 100644
--- a/sql/sql_udf.cc
+++ b/sql/sql_udf.cc
@@ -252,7 +252,7 @@ void udf_init()
}
}
}
- if (error > 0)
+ if (unlikely(error > 0))
sql_print_error("Got unknown error: %d", my_errno);
end_read_record(&read_record_info);
table->m_needs_reopen= TRUE; // Force close to free memory
@@ -453,7 +453,7 @@ static int mysql_drop_function_internal(THD *thd, udf_func *udf, TABLE *table)
HA_READ_KEY_EXACT))
{
int error;
- if ((error= table->file->ha_delete_row(table->record[0])))
+ if (unlikely((error= table->file->ha_delete_row(table->record[0]))))
table->file->print_error(error, MYF(0));
}
DBUG_RETURN(0);
@@ -513,7 +513,7 @@ int mysql_create_function(THD *thd,udf_func *udf)
{
if (thd->lex->create_info.or_replace())
{
- if ((error= mysql_drop_function_internal(thd, u_d, table)))
+ if (unlikely((error= mysql_drop_function_internal(thd, u_d, table))))
goto err;
}
else if (thd->lex->create_info.if_not_exists())
@@ -569,7 +569,7 @@ int mysql_create_function(THD *thd,udf_func *udf)
/* create entry in mysql.func table */
/* Allow creation of functions even if we can't open func table */
- if (!table)
+ if (unlikely(!table))
goto err;
table->use_all_columns();
restore_record(table, s->default_values); // Default values for fields
@@ -578,9 +578,9 @@ int mysql_create_function(THD *thd,udf_func *udf)
table->field[2]->store(u_d->dl,(uint) strlen(u_d->dl), system_charset_info);
if (table->s->fields >= 4) // If not old func format
table->field[3]->store((longlong) u_d->type, TRUE);
- error = table->file->ha_write_row(table->record[0]);
+ error= table->file->ha_write_row(table->record[0]);
- if (error)
+ if (unlikely(error))
{
my_error(ER_ERROR_ON_WRITE, MYF(0), "mysql.func", error);
del_udf(u_d);
@@ -591,7 +591,7 @@ done:
mysql_rwlock_unlock(&THR_LOCK_udf);
/* Binlog the create function. */
- if (write_bin_log(thd, TRUE, thd->query(), thd->query_length()))
+ if (unlikely(write_bin_log(thd, TRUE, thd->query(), thd->query_length())))
DBUG_RETURN(1);
DBUG_RETURN(0);