diff options
author | Bernard Normier <bernard@zeroc.com> | 2004-07-09 16:30:17 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2004-07-09 16:30:17 +0000 |
commit | 5880a4768276db3361d22a1d58cc2cded185ed89 (patch) | |
tree | c62e471543fad6e585877d1db004a65df07c5dff /cpp | |
parent | Fixes (diff) | |
download | ice-5880a4768276db3361d22a1d58cc2cded185ed89.tar.bz2 ice-5880a4768276db3361d22a1d58cc2cded185ed89.tar.xz ice-5880a4768276db3361d22a1d58cc2cded185ed89.zip |
Fixed bug: end of keys replaced by 0s
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/Freeze/EvictorIteratorI.cpp | 6 | ||||
-rw-r--r-- | cpp/src/Freeze/IndexI.cpp | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/cpp/src/Freeze/EvictorIteratorI.cpp b/cpp/src/Freeze/EvictorIteratorI.cpp index c82b9eb4af8..d85c1fffe46 100644 --- a/cpp/src/Freeze/EvictorIteratorI.cpp +++ b/cpp/src/Freeze/EvictorIteratorI.cpp @@ -121,6 +121,12 @@ Freeze::EvictorIteratorI::nextBatch() { try { + // + // It is critical to set key size to key capacity before the + // get, as a resize that increases the size inserts 0 + // + _key.resize(_key.capacity()); + _more = (dbc->get(&dbKey, &dbValue, flags) == 0); if(_more) { diff --git a/cpp/src/Freeze/IndexI.cpp b/cpp/src/Freeze/IndexI.cpp index 5e2ecca89c7..0bef0002e7a 100644 --- a/cpp/src/Freeze/IndexI.cpp +++ b/cpp/src/Freeze/IndexI.cpp @@ -82,6 +82,12 @@ Freeze::IndexI::untypedFindFirst(const Key& bytes, Int firstN) const { try { + // + // It is critical to set key size to key capacity before the + // get, as a resize that increases the size inserts 0 + // + pkey.resize(pkey.capacity()); + found = (dbc->pget(&dbKey, &pdbKey, &dbValue, flags) == 0); if(found) { |