summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authormonty@narttu.mysql.fi <>2003-06-24 12:10:35 +0300
committermonty@narttu.mysql.fi <>2003-06-24 12:10:35 +0300
commit1bd306ccd49e0ea6b9c91339b78b7b73f4137abd (patch)
tree415b1821c33eac5fc78fcb02664dfd546daa9406 /sql
parent7b7892afad1179fb0b0b7c3e920e9ee6a8709381 (diff)
downloadmariadb-git-1bd306ccd49e0ea6b9c91339b78b7b73f4137abd.tar.gz
Fixed some new memory leaks
Updated VC++ files
Diffstat (limited to 'sql')
-rw-r--r--sql/item_sum.cc3
-rw-r--r--sql/slave.cc9
-rw-r--r--sql/sql_client.cc2
-rw-r--r--sql/sql_help.cc25
4 files changed, 30 insertions, 9 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 34de672dbdb..6e606d53207 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -57,7 +57,8 @@ Item_sum::Item_sum(THD *thd, Item_sum &item):
void Item_sum::mark_as_sum_func()
{
- current_thd->lex.current_select->with_sum_func= with_sum_func= 1;
+ current_thd->lex.current_select->with_sum_func= 1;
+ with_sum_func= 1;
}
diff --git a/sql/slave.cc b/sql/slave.cc
index ccce8077cb8..c45c11f8bef 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -2177,7 +2177,7 @@ extern "C" pthread_handler_decl(handle_slave_io,arg)
DBUG_ENTER("handle_slave_io");
#ifndef DBUG_OFF
-slave_begin:
+slave_begin:
#endif
DBUG_ASSERT(mi->inited);
mysql= NULL ;
@@ -2218,7 +2218,7 @@ slave_begin:
if (!(mi->mysql = mysql = mysql_init(NULL)))
{
- sql_print_error("Slave I/O thread: error in mc_mysql_init()");
+ sql_print_error("Slave I/O thread: error in mysql_init()");
goto err;
}
@@ -2270,7 +2270,7 @@ dump");
goto err;
}
- thd->proc_info = "Waiiting to reconnect after a failed dump request";
+ thd->proc_info = "Waiting to reconnect after a failed dump request";
end_server(mysql);
/*
First time retry immediately, assuming that we can recover
@@ -3075,7 +3075,8 @@ replication resumed in log '%s' at position %s", mi->user,
static int safe_reconnect(THD* thd, MYSQL* mysql, MASTER_INFO* mi,
bool suppress_warnings)
{
- return connect_to_master(thd, mysql, mi, 1, suppress_warnings);
+ DBUG_ENTER("safe_reconnect");
+ DBUG_RETURN(connect_to_master(thd, mysql, mi, 1, suppress_warnings));
}
diff --git a/sql/sql_client.cc b/sql/sql_client.cc
index 464596f0734..1ae9a23a924 100644
--- a/sql/sql_client.cc
+++ b/sql/sql_client.cc
@@ -18,7 +18,7 @@
This files defines some MySQL C API functions that are server specific
*/
-#include <mysql_priv.h>
+#include "mysql_priv.h"
/*
Function called by my_net_init() to set some check variables
diff --git a/sql/sql_help.cc b/sql/sql_help.cc
index ba7c08ff15f..02fc8591370 100644
--- a/sql/sql_help.cc
+++ b/sql/sql_help.cc
@@ -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;
+}