Commit 5d1b6f98 authored by Yoni Fogel's avatar Yoni Fogel

Addresses #912

Use ybt->size field if ybt->ulen field is unset (for DB_DBT_REALLOC).

git-svn-id: file:///svn/tokudb@4505 c7de825b-a66e-492c-adef-691d508d4ae1
parent 941a2a24
......@@ -51,8 +51,9 @@ static inline int dbt_set_copy(DBT* ybt, bytevec* datap, ITEMLEN len, void** sta
tempdata = (void*)*datap;
do_malloc = FALSE;
}
else if (ybt->flags==DB_DBT_REALLOC) {
if (ybt->data && ybt->ulen>=len && ybt->ulen/2<=len) {
else if (ybt->flags==DB_DBT_REALLOC && ybt->data) {
if (!ybt->ulen) ybt->ulen = ybt->size;
if (ybt->ulen>=len && ybt->ulen/2<=len) {
tempdata = ybt->data;
do_malloc = FALSE;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment