1
0
Fork 0

improved dfdb output

This commit is contained in:
Jan Steemann 2015-11-04 12:17:29 +01:00
parent 9df8128b94
commit 3fd59fa3aa
1 changed files with 14 additions and 2 deletions

View File

@ -621,6 +621,8 @@ static TRI_df_scan_t ScanDatafile (TRI_datafile_t const* datafile) {
scan._status = 4;
}
entry._key = nullptr;
if (marker->_type == TRI_DOC_MARKER_KEY_DOCUMENT ||
marker->_type == TRI_DOC_MARKER_KEY_EDGE) {
char const* ptr = reinterpret_cast<char const*>(marker) + reinterpret_cast<TRI_doc_document_key_marker_t const*>(marker)->_offsetKey;
@ -630,8 +632,18 @@ static TRI_df_scan_t ScanDatafile (TRI_datafile_t const* datafile) {
char const* ptr = reinterpret_cast<char const*>(marker) + reinterpret_cast<TRI_doc_deletion_key_marker_t*>(marker)->_offsetKey;
entry._key = TRI_DuplicateString2Z(TRI_UNKNOWN_MEM_ZONE, ptr, strlen(ptr));
}
else {
entry._key = nullptr;
else if (marker->_type == TRI_DF_MARKER_SHAPE) {
char* p = ((char*) marker) + sizeof(TRI_df_shape_marker_t);
TRI_shape_t* l = (TRI_shape_t*) p;
std::string tmp("shape #");
tmp.append(std::to_string(l->_sid));
entry._key = TRI_DuplicateString2Z(TRI_UNKNOWN_MEM_ZONE, tmp.c_str(), tmp.size());
}
else if (marker->_type == TRI_DF_MARKER_ATTRIBUTE) {
TRI_shape_aid_t aid = reinterpret_cast<TRI_df_attribute_marker_t const*>(marker)->_aid;
std::string tmp("attribute #");
tmp.append(std::to_string(aid));
entry._key = TRI_DuplicateString2Z(TRI_UNKNOWN_MEM_ZONE, tmp.c_str(), tmp.size());
}
TRI_PushBackVector(&scan._entries, &entry);