[Commits] 801ba09: Postreview

Oleksandr Byelkin sanja at mariadb.com
Mon Sep 26 17:19:34 EEST 2016


revision-id: 801ba09ac8cf9488a2af1d1046b86dd3739a7c1a (mariadb-10.1.17-24-g801ba09)
parent(s): 420a02110a2b4e5bad967b79487e03f33b6afcb6
committer: Oleksandr Byelkin
timestamp: 2016-09-26 16:19:33 +0200
message:

Postreview

---
 include/my_tree.h |  2 +-
 mysys/tree.c      | 14 +++++++++++---
 sql/item_sum.cc   |  2 +-
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/include/my_tree.h b/include/my_tree.h
index 1aadb08..c255653 100644
--- a/include/my_tree.h
+++ b/include/my_tree.h
@@ -57,7 +57,7 @@ typedef struct st_tree_element {
 } TREE_ELEMENT;
 
 #define ELEMENT_CHILD(element, offs) (*(TREE_ELEMENT**)((char*)element + offs))
-#define R_ELEMENT_CHILD(element, offs) ((TREE_ELEMENT**)((char*)element + offs))
+#define ELEMENT_CHILD_PTR(element, offs) ((TREE_ELEMENT**)((char*)element + offs))
 
 typedef struct st_tree {
   TREE_ELEMENT *root,null_element;
diff --git a/mysys/tree.c b/mysys/tree.c
index 3709878..1ab32a2 100644
--- a/mysys/tree.c
+++ b/mysys/tree.c
@@ -173,7 +173,7 @@ static void free_tree(TREE *tree, myf free_flags)
       free_root(&tree->mem_root, free_flags);
     }
   }
-  if (tree->free_element && tree->with_delete && tree->free)
+  if (tree->free_element && tree->free)
       (*tree->free)(tree->free_element, free_free,
                     tree->custom_arg);
   tree->free_element= 0;
@@ -209,6 +209,12 @@ static void delete_tree_element(TREE *tree, TREE_ELEMENT *element)
   }
 }
 
+/**
+  exclude leaf node from the tree
+
+  @param tree            Tree where we deleting
+  @param parent          Pointer from parent to the element we are excluding
+*/
 
 void tree_exclude(TREE *tree, TREE_ELEMENT ***parent)
 {
@@ -260,7 +266,7 @@ TREE_ELEMENT *tree_insert(TREE *tree, void *key, uint key_size,
   int cmp;
   TREE_ELEMENT *element, ***parent;
 
-  if (tree->elements_limit && tree->elements_in_tree &&
+  if (tree->elements_limit &&
       tree->elements_in_tree >= tree->elements_limit)
   {
     /*
@@ -270,13 +276,15 @@ TREE_ELEMENT *tree_insert(TREE *tree, void *key, uint key_size,
       2) removing make incorrect search pass
       If we will not insert now, we leave freed element for future use
     */
+    // It is not checked with keys stored in the tree. That who need should,
+    // check it
     DBUG_ASSERT(key_size == 0);
 
     parent= tree->parents;
     *parent = &tree->root; element= tree->root;
     while (element != &tree->null_element)
     {
-      *++parent= R_ELEMENT_CHILD(element, tree->del_direction);
+      *++parent= ELEMENT_CHILD_PTR(element, tree->del_direction);
       element= ELEMENT_CHILD(element, tree->del_direction);
     }
     parent--;
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index f40bdfc..97b2b94 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -3402,7 +3402,7 @@ Item_func_group_concat::fix_fields(THD *thd, Item **ref)
   fixed= 1;
   return FALSE;
 }
-struct tree_node_size {void *left,*right; uint32 f;};
+
 
 bool Item_func_group_concat::setup(THD *thd)
 {


More information about the commits mailing list