summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mnogosearch.org>2013-11-08 23:14:26 +0400
committerAlexander Barkov <bar@mnogosearch.org>2013-11-08 23:14:26 +0400
commitef43b71fd20ba5cd8b85771dda1bd18f06625211 (patch)
tree3e27427460726f118a67d2f7c520f6ca99657a45 /sql/sql_show.cc
parentd79d0c4045f5b93ded001ca6b963727b3362cd15 (diff)
parent542ce5a068f2139c5b57ace8ba15b425fb570703 (diff)
downloadmariadb-git-ef43b71fd20ba5cd8b85771dda1bd18f06625211.tar.gz
Merge 5.3 -> 5.5
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 6c382a57eff..023796af4f2 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -2550,19 +2550,20 @@ void remove_status_vars(SHOW_VAR *list)
for (; list->name; list++)
{
- int res= 0, a= 0, b= all_status_vars.elements, c= (a+b)/2;
- for (; b-a > 0; c= (a+b)/2)
+ int first= 0, last= ((int) all_status_vars.elements) - 1;
+ for ( ; first <= last; )
{
- res= show_var_cmp(list, all+c);
- if (res < 0)
- b= c;
+ int res, middle= (first + last) / 2;
+ if ((res= show_var_cmp(list, all + middle)) < 0)
+ last= middle - 1;
else if (res > 0)
- a= c;
+ first= middle + 1;
else
+ {
+ all[middle].type= SHOW_UNDEF;
break;
+ }
}
- if (res == 0)
- all[c].type= SHOW_UNDEF;
}
shrink_var_array(&all_status_vars);
mysql_mutex_unlock(&LOCK_status);