1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fixed compiler and valgrind warnings

Added missing DBUG_xxx_RETURN statements
Fixed some usage of not initialized variables (as found by valgrind)
Ensure that we don't remove locked tables used as name locks from open table cache until unlock_table_names() are called.
This was fixed by having drop_locked_name() returning any table used as a name lock so that we can free it in unlock_table_names()
This will allow Tomas to continue with his work to use namelocks to syncronize things.

Note: valgrind still produces a lot of warnings about using not initialized code and shows memory loss errors when running the ndb tests
This commit is contained in:
monty@mysql.com
2006-03-29 14:27:36 +03:00
parent 8cb3cf2382
commit 1994ed49ec
44 changed files with 256 additions and 114 deletions

View File

@ -1770,18 +1770,19 @@ void free_status_vars()
there's lots of room for optimizing this, especially in non-sorted mode,
but nobody cares - it may be called only in case of failed plugin
initialization in the mysqld startup.
*/
void remove_status_vars(SHOW_VAR *list)
{
if (status_vars_inited)
{
pthread_mutex_lock(&LOCK_status);
SHOW_VAR *all= dynamic_element(&all_status_vars, 0, SHOW_VAR *);
int a= 0, b= all_status_vars.elements, c= (a+b)/2, res;
int a= 0, b= all_status_vars.elements, c= (a+b)/2;
for (; list->name; list++)
{
int res= 0;
for (a= 0, b= all_status_vars.elements; b-a > 1; c= (a+b)/2)
{
res= show_var_cmp(list, all+c);
@ -1789,7 +1790,8 @@ void remove_status_vars(SHOW_VAR *list)
b= c;
else if (res > 0)
a= c;
else break;
else
break;
}
if (res == 0)
all[c].type= SHOW_UNDEF;
@ -1800,7 +1802,7 @@ void remove_status_vars(SHOW_VAR *list)
else
{
SHOW_VAR *all= dynamic_element(&all_status_vars, 0, SHOW_VAR *);
int i;
uint i;
for (; list->name; list++)
{
for (i= 0; i < all_status_vars.elements; i++)