diff options
Diffstat (limited to 'sql/sql_analyse.h')
-rw-r--r-- | sql/sql_analyse.h | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/sql/sql_analyse.h b/sql/sql_analyse.h index faf79508f60..aa6d0dbb2d1 100644 --- a/sql/sql_analyse.h +++ b/sql/sql_analyse.h @@ -1,15 +1,15 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -21,8 +21,6 @@ #pragma interface /* gcc class implementation */ #endif -#include <my_tree.h> - #define DEC_IN_AVG 4 typedef struct st_number_info @@ -53,8 +51,14 @@ uint check_ulonglong(const char *str, uint length); bool get_ev_num_info(EV_NUM_INFO *ev_info, NUM_INFO *info, const char *num); bool test_if_number(NUM_INFO *info, const char *str, uint str_len); int compare_double(const double *s, const double *t); +int compare_double2(void* cmp_arg __attribute__((unused)), + const double *s, const double *t); int compare_longlong(const longlong *s, const longlong *t); +int compare_longlong2(void* cmp_arg __attribute__((unused)), + const longlong *s, const longlong *t); int compare_ulonglong(const ulonglong *s, const ulonglong *t); +int compare_ulonglong2(void* cmp_arg __attribute__((unused)), + const ulonglong *s, const ulonglong *t); Procedure *proc_analyse_init(THD *thd, ORDER *param, select_result *result, List<Item> &field_list); void free_string(String*); @@ -91,6 +95,11 @@ public: int collect_string(String *element, element_count count, TREE_INFO *info); +int sortcmp2(void* cmp_arg __attribute__((unused)), + const String *a,const String *b); +int stringcmp2(void* cmp_arg __attribute__((unused)), + const String *a,const String *b); + class field_str :public field_info { String min_arg, max_arg; @@ -105,9 +114,9 @@ public: max_arg(""), sum(0), must_be_blob(0), was_zero_fill(0), was_maybe_zerofill(0), can_be_still_num(1) - { init_tree(&tree, 0, sizeof(String), a->binary ? - (qsort_cmp) stringcmp : (qsort_cmp) sortcmp, - 0, (void (*)(void*)) free_string); }; + { init_tree(&tree, 0, 0, sizeof(String), a->binary ? + (qsort_cmp2) stringcmp2 : (qsort_cmp2) sortcmp2, + 0, (tree_element_free) free_string, NULL); }; void add(); void get_opt_type(String*, ha_rows); @@ -145,8 +154,8 @@ class field_real: public field_info public: field_real(Item* a, analyse* b) :field_info(a,b), min_arg(0), max_arg(0), sum(0), sum_sqr(0), max_notzero_dec_len(0) - { init_tree(&tree, 0, sizeof(double), - (qsort_cmp) compare_double, 0, NULL); } + { init_tree(&tree, 0, 0, sizeof(double), + (qsort_cmp2) compare_double2, 0, NULL, NULL); } void add(); void get_opt_type(String*, ha_rows); @@ -191,8 +200,8 @@ class field_longlong: public field_info public: field_longlong(Item* a, analyse* b) :field_info(a,b), min_arg(0), max_arg(0), sum(0), sum_sqr(0) - { init_tree(&tree, 0, sizeof(longlong), - (qsort_cmp) compare_longlong, 0, NULL); } + { init_tree(&tree, 0, 0, sizeof(longlong), + (qsort_cmp2) compare_longlong2, 0, NULL, NULL); } void add(); void get_opt_type(String*, ha_rows); @@ -236,8 +245,8 @@ class field_ulonglong: public field_info public: field_ulonglong(Item* a, analyse * b) :field_info(a,b), min_arg(0), max_arg(0), sum(0),sum_sqr(0) - { init_tree(&tree, 0, sizeof(ulonglong), - (qsort_cmp) compare_ulonglong, 0, NULL); } + { init_tree(&tree, 0, 0, sizeof(ulonglong), + (qsort_cmp2) compare_ulonglong2, 0, NULL, NULL); } void add(); void get_opt_type(String*, ha_rows); String *get_min_arg(String *s) { s->set(min_arg); return s; } |