diff options
author | varun <Varun Gupta> | 2020-09-17 17:35:10 +0530 |
---|---|---|
committer | varun <Varun Gupta> | 2020-09-17 19:37:45 +0530 |
commit | af34fcbe4f5a1e20fef1aef4b404678a52e0157f (patch) | |
tree | bf9a268ab96a1cf658a31c8d1719e84f5064a777 /sql/sql_statistics.cc | |
parent | 3d0ccf92963bed38a44cf77b1e7d573ce155a881 (diff) | |
download | mariadb-git-10.5-mdev21829.tar.gz |
Cleanup10.5-mdev21829
Diffstat (limited to 'sql/sql_statistics.cc')
-rw-r--r-- | sql/sql_statistics.cc | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index 74f3f442cd6..60e5b17fa81 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -1723,20 +1723,19 @@ public: if (!variable_size_keys) return true; // OOM - tree= new Unique_packed_single_arg((qsort_cmp2) simple_packed_str_key_cmp, - (void*) this, tree_key_length, - max_heap_table_size, 1); + tree= new Unique_packed((qsort_cmp2) simple_packed_str_key_cmp, + (void*) this, tree_key_length, + max_heap_table_size, 1); + if (!tree) + return true; // OOM return variable_size_keys->setup(thd, table_field); - } tree_key_length= table_field->pack_length(); tree= new Unique((qsort_cmp2) simple_str_key_cmp, (void*) table_field, tree_key_length, max_heap_table_size, 1); - if (!tree) - return true; // OOM - return false; + return tree == NULL; } @@ -1835,7 +1834,7 @@ int Count_distinct_field::simple_packed_str_key_cmp(void* arg, { Count_distinct_field *compare_arg= (Count_distinct_field*)arg; DBUG_ASSERT(compare_arg->variable_size_keys); - return compare_arg->variable_size_keys->compare_packed_keys(key1, key2); + return compare_arg->variable_size_keys->compare_keys_for_single_arg(key1, key2); } @@ -1853,7 +1852,7 @@ public: bool add() { - longlong val= table_field->val_int(); + longlong val= table_field->val_int(); return tree->unique_add(&val, tree->get_size()); } bool setup(THD *thd, size_t max_heap_table_size) @@ -1862,10 +1861,7 @@ public: tree= new Unique((qsort_cmp2) simple_ulonglong_key_cmp, (void*) &tree_key_length, tree_key_length, max_heap_table_size, 1); - if (!tree) - return true; // OOM - - return tree->setup(thd, table_field); + return tree == NULL; } static int simple_ulonglong_key_cmp(void* arg, uchar* key1, uchar* key2); }; |