summaryrefslogtreecommitdiff
path: root/sql/opt_sum.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/opt_sum.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/opt_sum.cc')
-rw-r--r--sql/opt_sum.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index 43d1c2de7ad..82946709166 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -316,7 +316,7 @@ int opt_sum_query(THD *thd,
else
{
error= tl->table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);
- if(error)
+ if (unlikely(error))
{
tl->table->file->print_error(error, MYF(ME_FATALERROR));
DBUG_RETURN(error);
@@ -400,15 +400,16 @@ int opt_sum_query(THD *thd,
}
longlong info_limit= 1;
table->file->info_push(INFO_KIND_FORCE_LIMIT_BEGIN, &info_limit);
- if (!(error= table->file->ha_index_init((uint) ref.key, 1)))
+ if (likely(!(error= table->file->ha_index_init((uint) ref.key, 1))))
error= (is_max ?
get_index_max_value(table, &ref, range_fl) :
get_index_min_value(table, &ref, item_field, range_fl,
prefix_len));
/* Verify that the read tuple indeed matches the search key */
- if (!error && reckey_in_range(is_max, &ref, item_field->field,
- conds, range_fl, prefix_len))
+ if (!error &&
+ reckey_in_range(is_max, &ref, item_field->field,
+ conds, range_fl, prefix_len))
error= HA_ERR_KEY_NOT_FOUND;
table->file->ha_end_keyread();
table->file->ha_index_end();
@@ -478,7 +479,7 @@ int opt_sum_query(THD *thd,
}
}
- if (thd->is_error())
+ if (unlikely(thd->is_error()))
DBUG_RETURN(thd->get_stmt_da()->sql_errno());
/*