summaryrefslogtreecommitdiff
path: root/sql/field.h
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-05-16 07:39:15 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-05-16 07:39:15 +0300
commit9e6e43551fc61bc34152f8d60f5d72f0d3814787 (patch)
tree67a834e1fee12ed5d4bf9897aa00146d728d936b /sql/field.h
parent4f29d776c756ac522ae49c481ea8975dee8787fe (diff)
parent3d0bb2b7f1eb39d1b3773e634499ff98576679f7 (diff)
downloadmariadb-git-9e6e43551fc61bc34152f8d60f5d72f0d3814787.tar.gz
Merge 10.3 into 10.4
We will expose some more std::atomic internals in Atomic_counter, so that dict_index_t::lock will support the default assignment operator.
Diffstat (limited to 'sql/field.h')
-rw-r--r--sql/field.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/sql/field.h b/sql/field.h
index 773f0e05468..0715981431b 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -1,7 +1,7 @@
#ifndef FIELD_INCLUDED
#define FIELD_INCLUDED
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2008, 2019, MariaDB Corporation.
+ Copyright (c) 2008, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -825,6 +825,19 @@ public:
DBUG_ASSERT(ls.length < UINT_MAX32);
return store(ls.str, (uint) ls.length, cs);
}
+
+#ifdef HAVE_valgrind_or_MSAN
+ /**
+ Mark unused memory in the field as defined. Mainly used to ensure
+ that if we write full field to disk (for example in
+ Count_distinct_field::add(), we don't write unitalized data to
+ disk which would confuse valgrind or MSAN.
+ */
+ virtual void mark_unused_memory_as_defined() {}
+#else
+ void mark_unused_memory_as_defined() {}
+#endif
+
virtual double val_real(void)=0;
virtual longlong val_int(void)=0;
/*
@@ -3679,6 +3692,9 @@ public:
}
int store(const char *to,size_t length,CHARSET_INFO *charset);
using Field_str::store;
+#ifdef HAVE_valgrind_or_MSAN
+ void mark_unused_memory_as_defined();
+#endif
double val_real(void);
longlong val_int(void);
String *val_str(String*,String *);