summaryrefslogtreecommitdiff
path: root/cpp/src/Freeze/MapI.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/MapI.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/MapI.cpp')
-rw-r--r--cpp/src/Freeze/MapI.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/cpp/src/Freeze/MapI.cpp b/cpp/src/Freeze/MapI.cpp
index 5d6744252a2..4c3783dca80 100644
--- a/cpp/src/Freeze/MapI.cpp
+++ b/cpp/src/Freeze/MapI.cpp
@@ -224,7 +224,13 @@ Freeze::IteratorHelperI::find(const Key& key) const
{
Dbt dbKey;
initializeInDbt(key, 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);
+
//
// Keep 0 length since we're not interested in the data
//
@@ -257,7 +263,9 @@ Freeze::IteratorHelperI::find(const Key& key) const
}
catch(const ::DbException& dx)
{
- handleDbException(dx, const_cast<Key&>(key), dbKey, __FILE__, __LINE__);
+ DatabaseException ex(__FILE__, __LINE__);
+ ex.message = dx.what();
+ throw ex;
}
}
}
@@ -1470,6 +1478,13 @@ Freeze::MapIndexI::untypedCount(const Key& k, const ConnectionIPtr& connection)
{
Dbt dbKey;
initializeInDbt(k, 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);