summaryrefslogtreecommitdiff
path: root/sql/field.h
diff options
context:
space:
mode:
authorTor Didriksen <tor.didriksen@oracle.com>2012-04-12 15:04:22 +0200
committerTor Didriksen <tor.didriksen@oracle.com>2012-04-12 15:04:22 +0200
commit582b7283472a43af5d7fb51386df055ea9d44a96 (patch)
tree3a272d304a40e4f35352c9eff016ee04b0d5cc08 /sql/field.h
parentd59986d97418d588ed193d01284a21676d208f1a (diff)
downloadmariadb-git-582b7283472a43af5d7fb51386df055ea9d44a96.tar.gz
Bug#13871079 RQG_MYISAM_DML_ALTER_VALGRIND FAILS ON VALGRIND PN PB2
The class Copy_field contains a String tmp, which may allocate memory on the heap. That means that all instances of Copy_field must be properly destroyed. Alas they are not. Solution: don't use Copy_field::tmp for copying from_field => tmp => to_field in do_field_string()
Diffstat (limited to 'sql/field.h')
-rw-r--r--sql/field.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/field.h b/sql/field.h
index b4adb764b22..674b58108d4 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -1985,7 +1985,8 @@ public:
:Field_enum(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg,
packlength_arg,
- typelib_arg,charset_arg)
+ typelib_arg,charset_arg),
+ empty_set_string("", 0, charset_arg)
{
flags=(flags & ~ENUM_FLAG) | SET_FLAG;
}
@@ -1996,8 +1997,11 @@ public:
virtual bool zero_pack() const { return 1; }
String *val_str(String*,String *);
void sql_type(String &str) const;
+ uint size_of() const { return sizeof(*this); }
enum_field_types real_type() const { return MYSQL_TYPE_SET; }
bool has_charset(void) const { return TRUE; }
+private:
+ const String empty_set_string;
};
@@ -2192,6 +2196,8 @@ public:
{
return (flags & (BINCMP_FLAG | BINARY_FLAG)) != 0;
}
+private:
+ const String empty_set_string;
};