mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
[t:4015] Deal with broken case for NULL descriptors. Somehow I didn't notice that the tests failed. Refs #4015.
git-svn-id: file:///svn/toku/tokudb@37915 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
3377a9d8d8
commit
f8a3033c00
1 changed files with 11 additions and 1 deletions
12
newbrt/brt.c
12
newbrt/brt.c
|
@ -931,7 +931,17 @@ int toku_brtnode_pf_callback(void* brtnode_pv, void* read_extraargs, int fd, PAI
|
|||
// Copy the descriptor into a temporary variable, and tell DRD that subsequent code happens after reading that pointer.
|
||||
// In combination with the annotation in toku_update_descriptor, this seems to be enough to convince test_4015 that all is well.
|
||||
// Otherwise, drd complains that the newly malloc'd descriptor string is touched later by some comparison operation.
|
||||
#define FAKE_DB(db, desc_var, desc) DESCRIPTOR_S desc_var = *(desc); struct __toku_db db = {.descriptor= &desc_var}; ANNOTATE_HAPPENS_AFTER(&(desc)->dbt.data);
|
||||
static inline void setup_fake_db (DB *fake_db, DESCRIPTOR fake_desc, DESCRIPTOR orig_desc) {
|
||||
static const struct __toku_db zero_db; // it's static, so it's all zeros.
|
||||
*fake_db = zero_db;
|
||||
if (orig_desc) {
|
||||
fake_db->descriptor = fake_desc;
|
||||
*fake_desc = *orig_desc;
|
||||
ANNOTATE_HAPPENS_AFTER(&orig_desc->dbt.data);
|
||||
}
|
||||
}
|
||||
|
||||
#define FAKE_DB(db, desc_var, desc) DESCRIPTOR_S desc_var; struct __toku_db db; setup_fake_db(&db, &desc_var, (desc))
|
||||
|
||||
static int
|
||||
leafval_heaviside_le (u_int32_t klen, void *kval,
|
||||
|
|
Loading…
Add table
Reference in a new issue