summaryrefslogtreecommitdiff
path: root/cpp/src/Freeze/IndexI.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2006-11-06 18:31:18 +0000
committerBernard Normier <bernard@zeroc.com>2006-11-06 18:31:18 +0000
commitdc920b125cb77a1ff24fe8a00d5e34db65ca3e30 (patch)
tree4501513b7399e30f8ee0c5c453ba64ddf0941221 /cpp/src/Freeze/IndexI.cpp
parentFix (diff)
downloadice-dc920b125cb77a1ff24fe8a00d5e34db65ca3e30.tar.bz2
ice-dc920b125cb77a1ff24fe8a00d5e34db65ca3e30.tar.xz
ice-dc920b125cb77a1ff24fe8a00d5e34db65ca3e30.zip
Bug fix for bug #1513
Diffstat (limited to 'cpp/src/Freeze/IndexI.cpp')
-rw-r--r--cpp/src/Freeze/IndexI.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/cpp/src/Freeze/IndexI.cpp b/cpp/src/Freeze/IndexI.cpp
index 50509e66b8e..cd1b2a929ea 100644
--- a/cpp/src/Freeze/IndexI.cpp
+++ b/cpp/src/Freeze/IndexI.cpp
@@ -41,12 +41,14 @@ Freeze::IndexI::untypedFindFirst(const Key& bytes, Int firstN) const
Dbt dbKey;
initializeInDbt(bytes, dbKey);
-
//
- // Berkeley DB 4.1.25 bug: it should not write into dbKey
+ // When we have a custom-comparison function, Berkeley DB returns
+ // the key on-disk (when it finds one). We disable this behavior:
+ // (ref Oracle SR 5925672.992)
//
- dbKey.set_ulen(static_cast<u_int32_t>(bytes.size()));
-
+ dbKey.set_flags(DB_DBT_USERMEM | DB_DBT_PARTIAL);
+
+
Key pkey(1024);
Dbt pdbKey;
initializeOutDbt(pkey, pdbKey);
@@ -185,6 +187,13 @@ Freeze::IndexI::untypedCount(const Key& bytes) const
Dbt dbKey;
initializeInDbt(bytes, dbKey);
+ //
+ // When we have a custom-comparison function, Berkeley DB returns
+ // the key on-disk (when it finds one). We disable this behavior:
+ // (ref Oracle SR 5925672.992)
+ //
+ dbKey.set_flags(DB_DBT_USERMEM | DB_DBT_PARTIAL);
+
Dbt dbValue;
dbValue.set_flags(DB_DBT_USERMEM | DB_DBT_PARTIAL);