summaryrefslogtreecommitdiff
path: root/sql/sp_rcontext.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2018-04-04 12:16:12 +0300
committerMonty <monty@mariadb.org>2018-05-07 00:07:32 +0300
commit30ebc3ee9efcab635b1f3e14b9198a58ae93c233 (patch)
tree81e3ad66cd4ec8693964317cbf23515d0e9ecf35 /sql/sp_rcontext.cc
parenta22a339f8e044a1e8df011beb0b4c8f43792ac96 (diff)
downloadmariadb-git-30ebc3ee9efcab635b1f3e14b9198a58ae93c233.tar.gz
Add likely/unlikely to speed up execution
Added to: - if (error) - Lex - sql_yacc.yy and sql_yacc_ora.yy - In header files to alloc() calls - Added thd argument to thd_net_is_killed()
Diffstat (limited to 'sql/sp_rcontext.cc')
-rw-r--r--sql/sp_rcontext.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc
index 2e9ae23d7f9..65c4e801cf1 100644
--- a/sql/sp_rcontext.cc
+++ b/sql/sp_rcontext.cc
@@ -234,7 +234,7 @@ bool Qualified_column_ident::resolve_type_ref(THD *thd, Column_definition *def)
!open_tables_only_view_structure(thd, table_list,
thd->mdl_context.has_locks()))
{
- if ((src= lex.query_tables->table->find_field_by_name(&m_column)))
+ if (likely((src= lex.query_tables->table->find_field_by_name(&m_column))))
{
if (!(rc= check_column_grant_for_type_ref(thd, table_list,
m_column.str,
@@ -486,14 +486,14 @@ bool sp_rcontext::handle_sql_condition(THD *thd,
handlers from this context are applicable: try to locate one
in the outer scope.
*/
- if (thd->is_fatal_sub_stmt_error && m_in_sub_stmt)
+ if (unlikely(thd->is_fatal_sub_stmt_error) && m_in_sub_stmt)
DBUG_RETURN(false);
Diagnostics_area *da= thd->get_stmt_da();
const sp_handler *found_handler= NULL;
const Sql_condition *found_condition= NULL;
- if (thd->is_error())
+ if (unlikely(thd->is_error()))
{
found_handler=
cur_spi->m_ctx->find_handler(da->get_error_condition_identity());