Skip to content

Commit 4ea1c48

Browse files
committed
Added a function comment to Field_varstring::mark_unused_memory_as_defined()
1 parent 8d37ef2 commit 4ea1c48

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

sql/field.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7867,6 +7867,19 @@ bool Field_varstring::send(Protocol *protocol)
78677867

78687868

78697869
#ifdef HAVE_MEM_CHECK
7870+
7871+
/*
7872+
Mark the unused part of the varstring as defined.
7873+
7874+
This function is only used be Unique when calculating statistics.
7875+
7876+
The marking is needed as we write the whole tree to disk in case of
7877+
overflows. For using or comparing values the undefined value part
7878+
is never used. We could also use bzero() here, but it would be
7879+
slower in production environments.
7880+
This function is tested by main.stat_tables-enospc
7881+
*/
7882+
78707883
void Field_varstring::mark_unused_memory_as_defined()
78717884
{
78727885
uint used_length __attribute__((unused)) = get_length();

0 commit comments

Comments
 (0)