1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Fixed some new memory leaks

Updated VC++ files


VC++Files/client/mysql.dsp:
  Update of VC++ files
VC++Files/client/mysqlclient.dsp:
  Update of VC++ files
VC++Files/libmysqld/examples/test_libmysqld.dsp:
  Update of VC++ files
VC++Files/libmysqld/libmysqld.def:
  Update of VC++ files
VC++Files/libmysqld/libmysqld.dsp:
  Update of VC++ files
VC++Files/myisam/myisam.dsp:
  Update of VC++ files
VC++Files/mysql.dsw:
  Update of VC++ files
VC++Files/sql/mysqld.dsp:
  Update of VC++ files
include/mysql.h:
  Add missing client functions to embedded server
libmysql/libmysql.def:
  sort functions to enable comparison with libmysqld.def
libmysqld/libmysqld.c:
  Add missing client functions to embedded server
libmysqld/libmysqld.def:
  sort functions to enable comparison with libmysql.def
  Added missing functions
myisam/mi_preload.c:
  Fixed compiler warning.
  Small code cleanup
scripts/make_win_src_distribution.sh:
  Fixed typo
  Don't run zip in verbose mode
scripts/mysql_create_system_tables.sh:
  Change so that localhost has full access (to make this like 4.0)
scripts/mysql_fix_privilege_tables.sh:
  Allow on to run this from the source distribution
sql-common/client.c:
  Fixed memory leak
sql/item_sum.cc:
  Removed compiler warning
sql/slave.cc:
  Cleanup
sql/sql_client.cc:
  Portability fix
sql/sql_help.cc:
  Fixed memory leak
This commit is contained in:
unknown
2003-06-24 12:10:35 +03:00
parent 01450dbb79
commit fff1f663c2
21 changed files with 566 additions and 298 deletions

View File

@ -22,6 +22,8 @@ struct st_find_field
Field *field;
};
static void free_select(SQL_SELECT *sel);
/* Used fields */
static struct st_find_field init_used_fields[]=
@ -62,6 +64,7 @@ enum enum_used_fields
help_relation_help_keyword_id
};
/*
Fill st_find_field structure with pointers to fields
@ -94,8 +97,8 @@ static bool init_fields(THD *thd, TABLE_LIST *tables,
DBUG_RETURN(0);
}
/*
/*
Returns variants of found topic for help (if it is just single topic,
returns description and example, or else returns only names..)
@ -135,7 +138,7 @@ void memorize_variant_topic(THD *thd, TABLE *topics, int count,
}
else
{
if (count==1)
if (count == 1)
names->push_back(name);
String *new_name= new String;
get_field(mem_root,find_fields[help_topic_name].field,new_name);
@ -557,7 +560,7 @@ int send_variant_2_list(MEM_ROOT *mem_root, Protocol *protocol,
String **end= pointers + names->elements;
List_iterator<String> it(*names);
for ( pos= pointers; pos!=end; (*pos++= it++));
for (pos= pointers; pos!=end; (*pos++= it++));
qsort(pointers,names->elements,sizeof(String*),string_ptr_cmp);
@ -627,6 +630,7 @@ SQL_SELECT *prepare_select_for_name(THD *thd, const char *mask, uint mlen,
return prepare_simple_select(thd,cond,tables,table,error);
}
/*
Server-side function 'help'
@ -783,6 +787,21 @@ int mysqld_help(THD *thd, const char *mask)
res= 0;
send_eof(thd);
end:
free_select(select_topics_by_name);
free_select(select_keyword_by_name);
free_select(select_cat_by_name);
free_select(select_topics_by_cat);
free_select(select_cat_by_cat);
free_select(select_root_cats);
DBUG_RETURN(res);
}
static void free_select(SQL_SELECT *sel)
{
if (sel)
delete sel->quick;
}