- **status**: unassigned --> accepted
- **assigned_to**: Anders Bjornerstedt
---
** [tickets:#1097] imm: using invalid iterator in migrateObj**
**Status:** accepted
**Milestone:** 4.3.3
**Created:** Tue Sep 16, 2014 02:24 PM UTC by Zoran Milinkovic
**Last Updated:** Tue Sep 16, 2014 02:24 PM UTC
**Owner:** Anders Bjornerstedt
Schema change from single value to multi value attribute, iterator is
incorrectly used.
/* Adjust existing attributes.*/
ImmAttrValueMap::iterator oavi;
for(oavi = object->mAttrValueMap.begin();
oavi != object->mAttrValueMap.end(); ++oavi) {
/*
TRACE_5("CHECKING existing attribute %s:%s for object %s",
className.c_str(), oavi->first.c_str(), objectDn.c_str());
*/
/* Change from single to multi-value requires change of value rep.*/
ai = changedAttrs.find(oavi->first);
if(ai != changedAttrs.end()) {
if((ai->second->mFlags & SA_IMM_ATTR_MULTI_VALUE) &&
(!oavi->second->isMultiValued())) {
attrValue = new ImmAttrMultiValue(*(oavi->second));
TRACE_5("Schema change adjusted attribute %s in object:%s "
"to be multivalued", oavi->first.c_str(), objectDn.c_str());
delete oavi->second;
object->mAttrValueMap.erase(oavi);
object->mAttrValueMap[ai->first] = attrValue;
}
}
/* Correct object->mAdminOwnerAttrVal. */
if(oavi->first == std::string(SA_IMM_ATTR_ADMIN_OWNER_NAME)) {
object->mAdminOwnerAttrVal = oavi->second;
TRACE_5("Schema change corrected attr %s in object:%s",
oavi->first.c_str(), objectDn.c_str());
}
}
---
Sent from sourceforge.net because opensaf-tickets@lists.sourceforge.net is
subscribed to https://sourceforge.net/p/opensaf/tickets/
To unsubscribe from further messages, a project admin can change settings at
https://sourceforge.net/p/opensaf/admin/tickets/options. Or, if this is a
mailing list, you can unsubscribe from the mailing list.
------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-tickets mailing list
Opensaf-tickets@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-tickets