#At file:///home/kgeorge/mysql/bzr/B32124-6.0-bugteam/
2865 Georgi Kodinov 2008-10-10 [merge]
merged 5.1-bugteam -> 6.0-bugteam
modified:
mysql-test/valgrind.supp
sql/item_func.cc
sql/item_func.h
=== modified file 'mysql-test/valgrind.supp'
--- a/mysql-test/valgrind.supp 2008-08-13 09:00:54 +0000
+++ b/mysql-test/valgrind.supp 2008-10-10 11:50:46 +0000
@@ -521,6 +521,15 @@
fun:_dl_open
}
+{
+ libc pthread_exit 8
+ Memcheck:Leak
+ fun:malloc
+ fun:local_strdup
+ fun:_dl_map_object
+ fun:dl_open_worker
+}
+
#
# This is seen internally in the system libraries on 64-bit RHAS3.
#
=== modified file 'sql/item_func.cc'
--- a/sql/item_func.cc 2008-10-08 15:37:32 +0000
+++ b/sql/item_func.cc 2008-10-10 11:50:46 +0000
@@ -4879,8 +4879,8 @@ Item_func_get_system_var::
Item_func_get_system_var(sys_var *var_arg, enum_var_type var_type_arg,
LEX_STRING *component_arg, const char *name_arg,
size_t name_len_arg)
- :var(var_arg), var_type(var_type_arg), component(*component_arg),
- cache_present(0)
+ :var(var_arg), var_type(var_type_arg), orig_var_type(var_type_arg),
+ component(*component_arg), cache_present(0)
{
/* set_name() will allocate the name */
set_name(name_arg, name_len_arg, system_charset_info);
@@ -5014,7 +5014,7 @@ longlong Item_func_get_system_var::val_i
{
THD *thd= current_thd;
- if (thd->query_id == used_query_id)
+ if (cache_present && thd->query_id == used_query_id)
{
if (cache_present & GET_SYS_VAR_CACHE_LONG)
{
@@ -5090,7 +5090,7 @@ String* Item_func_get_system_var::val_st
{
THD *thd= current_thd;
- if (thd->query_id == used_query_id)
+ if (cache_present && thd->query_id == used_query_id)
{
if (cache_present & GET_SYS_VAR_CACHE_STRING)
{
@@ -5170,7 +5170,7 @@ double Item_func_get_system_var::val_rea
{
THD *thd= current_thd;
- if (thd->query_id == used_query_id)
+ if (cache_present && thd->query_id == used_query_id)
{
if (cache_present & GET_SYS_VAR_CACHE_DOUBLE)
{
@@ -5265,6 +5265,15 @@ bool Item_func_get_system_var::eq(const
}
+void Item_func_get_system_var::cleanup()
+{
+ Item_func::cleanup();
+ cache_present= 0;
+ var_type= orig_var_type;
+ cached_strval.free();
+}
+
+
longlong Item_func_inet_aton::val_int()
{
DBUG_ASSERT(fixed == 1);
=== modified file 'sql/item_func.h'
--- a/sql/item_func.h 2008-10-08 15:37:32 +0000
+++ b/sql/item_func.h 2008-10-10 11:50:46 +0000
@@ -1432,7 +1432,7 @@ public:
class Item_func_get_system_var :public Item_func
{
sys_var *var;
- enum_var_type var_type;
+ enum_var_type var_type, orig_var_type;
LEX_STRING component;
longlong cached_llval;
double cached_dval;
@@ -1467,6 +1467,8 @@ public:
*/
bool is_written_to_binlog();
bool eq(const Item *item, bool binary_cmp) const;
+
+ void cleanup();
};
| Thread |
|---|
| • bzr commit into mysql-6.0 branch (kgeorge:2865) | Georgi Kodinov | 10 Oct |