1
0
Fork 0

enterprise id lookup

This commit is contained in:
Kaveh Vahedipour 2016-09-28 11:38:29 +02:00
parent f96bfbfade
commit b7ad4ebe70
1 changed files with 14 additions and 1 deletions

View File

@ -721,7 +721,20 @@ std::string Transaction::makeIdFromCustom(CollectionNameResolver const* resolver
// create a buffer big enough for collection name + _key // create a buffer big enough for collection name + _key
std::string buffer; std::string buffer;
buffer.reserve(TRI_COL_NAME_LENGTH + TRI_VOC_KEY_MAX_LENGTH + 2); buffer.reserve(TRI_COL_NAME_LENGTH + TRI_VOC_KEY_MAX_LENGTH + 2);
buffer.append(resolver->getCollectionNameCluster(cid)); std::string resolved = resolver->getCollectionNameCluster(cid);
#ifdef USE_ENTERPRISE
if (size_t pos = resolved.find("_local_") != std::string::npos) {
resolved.erase(pos,7);
}
if (size_t pos = resolved.find("_from_") != std::string::npos) {
resolved.erase(pos,6);
}
if (size_t pos = resolved.find("_to_") != std::string::npos) {
resolved.erase(pos,4);
}
#endif
buffer.append(resolved);
buffer.append("/"); buffer.append("/");
VPackValueLength keyLength; VPackValueLength keyLength;