summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgi Kodinov <kgeorge@mysql.com>2008-10-10 12:52:23 +0300
committerGeorgi Kodinov <kgeorge@mysql.com>2008-10-10 12:52:23 +0300
commitfeb051be817e31cac77eeda6c011855c927faf88 (patch)
tree65833fb51534e5e63a41939a3ce51771fc031e83
parent486a0d7e14d5f83db6721d9694eaa9976ce329fc (diff)
downloadmariadb-git-feb051be817e31cac77eeda6c011855c927faf88.tar.gz
Bug #32124 addendum #2
- fixed an unitialized memory read - fixed a compilation warning - added a suppression for FC9 x86_64 mysql-test/valgrind.supp: Bug #3214: added a suppression for FC9 x86_64 sql/item_func.cc: Bug #32124 - fixed an unitialized memory read - fixed a compilation warning
-rw-r--r--mysql-test/valgrind.supp9
-rw-r--r--sql/item_func.cc8
2 files changed, 13 insertions, 4 deletions
diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp
index cb1b07c83b0..64c439314a9 100644
--- a/mysql-test/valgrind.supp
+++ b/mysql-test/valgrind.supp
@@ -444,6 +444,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.
#
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 876e47e5c66..185100bf125 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -4935,7 +4935,7 @@ longlong Item_func_get_system_var::val_int()
{
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)
{
@@ -5011,7 +5011,7 @@ String* Item_func_get_system_var::val_str(String* str)
{
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)
{
@@ -5091,7 +5091,7 @@ double Item_func_get_system_var::val_real()
{
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)
{
@@ -5189,7 +5189,7 @@ bool Item_func_get_system_var::eq(const Item *item, bool binary_cmp) const
void Item_func_get_system_var::cleanup()
{
Item_func::cleanup();
- cache_present= NULL;
+ cache_present= 0;
var_type= orig_var_type;
cached_strval.free();
}