mdbx-test: add data-check before delete/update.

Change-Id: I5afc1cbd95b5db0b442714229510d6786bf68d43
This commit is contained in:
Leonid Yuriev
2018-09-17 13:06:43 +03:00
parent 68fd9c9908
commit 01ae5bad7d
5 changed files with 23 additions and 1 deletions

View File

@@ -91,6 +91,11 @@ bool hex2data(const char *hex_begin, const char *hex_end, void *ptr,
return true;
}
bool is_samedata(const MDBX_val *a, const MDBX_val *b) {
return a->iov_len == b->iov_len &&
memcmp(a->iov_base, b->iov_base, a->iov_len) == 0;
}
//-----------------------------------------------------------------------------
/* TODO: replace my 'libmera' from t1ha. */