From f30b5654c07b72986ec5c52bc1ad4618e679e36f Mon Sep 17 00:00:00 2001
From: Leif Walsh <leif@tokutek.com>
Date: Wed, 17 Apr 2013 00:02:11 -0400
Subject: [PATCH] [t:5013] don't initialize dest_val if src_val is empty in
 tokudb_generate_row on mainline too.  fixes #5013

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@44256 c7de825b-a66e-492c-adef-691d508d4ae1
---
 storage/tokudb/ha_tokudb.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc
index fabf5531ad..3dc9a76e24 100644
--- a/storage/tokudb/ha_tokudb.cc
+++ b/storage/tokudb/ha_tokudb.cc
@@ -1151,11 +1151,11 @@ static inline int tokudb_generate_row(
     desc_size = (*(u_int32_t *)row_desc) - 4;
     row_desc += 4;
     if (dest_val != NULL) {
-        if (!is_key_clustering(row_desc, desc_size)) {
+        if (!is_key_clustering(row_desc, desc_size) || src_val->size == 0) {
             dest_val->size = 0;
         }
         else {
-            uchar* buff = NULL;            
+            uchar* buff = NULL;
             if (dest_val->flags == 0) {
                 dest_val->ulen = 0;
                 dest_val->size = 0;
-- 
2.30.9