From 10b233e7d706e160f70937d2d212fb80471bc385 Mon Sep 17 00:00:00 2001 From: yeoncheol-kim Date: Thu, 4 Jul 2024 16:33:08 +0900 Subject: [PATCH] INTERNAL: Move a 'replaced' initialization in btree insert --- engines/default/coll_btree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engines/default/coll_btree.c b/engines/default/coll_btree.c index 5587b94b7..e61853892 100644 --- a/engines/default/coll_btree.c +++ b/engines/default/coll_btree.c @@ -2209,8 +2209,6 @@ static ENGINE_ERROR_CODE do_btree_elem_link(btree_meta_info *info, btree_elem_it int ovfl_type = OVFL_TYPE_NONE; ENGINE_ERROR_CODE res; - if (replaced) *replaced = false; - assert(info->root->ndepth < BTREE_MAX_DEPTH); res = do_btree_find_insposi(info->root, elem->data, elem->nbkey, path); if (res == ENGINE_SUCCESS) { @@ -3724,6 +3722,8 @@ ENGINE_ERROR_CODE btree_elem_insert(const char *key, const uint32_t nkey, PERSISTENCE_ACTION_BEGIN(cookie, UPD_BT_ELEM_INSERT); *created = false; + *replaced = false; + if (trimmed_elems != NULL) { /* initialize as no trimmed element */ *trimmed_elems = NULL;