diff options
author | Monty <monty@mariadb.org> | 2018-04-04 12:16:12 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2018-05-07 00:07:32 +0300 |
commit | 30ebc3ee9efcab635b1f3e14b9198a58ae93c233 (patch) | |
tree | 81e3ad66cd4ec8693964317cbf23515d0e9ecf35 /sql/sql_admin.cc | |
parent | a22a339f8e044a1e8df011beb0b4c8f43792ac96 (diff) | |
download | mariadb-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/sql_admin.cc')
-rw-r--r-- | sql/sql_admin.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index 45c48dd41cc..8c11886998e 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -267,7 +267,7 @@ end: tdc_release_share(table->s); } /* In case of a temporary table there will be no metadata lock. */ - if (error && has_mdl_lock) + if (unlikely(error) && has_mdl_lock) thd->mdl_context.release_transactional_locks(); DBUG_RETURN(error); @@ -525,7 +525,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, If open_and_lock_tables() failed, close_thread_tables() will close the table and table->table can therefore be invalid. */ - if (open_error) + if (unlikely(open_error)) table->table= NULL; /* @@ -533,7 +533,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, so any errors opening the table are logical errors. In these cases it does not make sense to try to repair. */ - if (open_error && thd->locked_tables_mode) + if (unlikely(open_error) && thd->locked_tables_mode) { result_code= HA_ADMIN_FAILED; goto send_result; @@ -828,7 +828,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, repair_table_use_frm, FALSE); thd->open_options&= ~extra_open_options; - if (!open_error) + if (unlikely(!open_error)) { TABLE *tab= table->table; Field **field_ptr= tab->field; |