summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 0c22d4ce23c..a6d9ecc1d2f 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -4725,7 +4725,8 @@ update_hash(user_var_entry *entry, bool set_null, void *ptr, size_t length,
length--; // Fix length change above
entry->value[length]= 0; // Store end \0
}
- memmove(entry->value, ptr, length);
+ if (length)
+ memmove(entry->value, ptr, length);
if (type == DECIMAL_RESULT)
((my_decimal*)entry->value)->fix_buffer_pointer();
entry->length= length;