diff options
author | unknown <ram@gw.mysql.r18.ru> | 2004-11-25 16:18:48 +0400 |
---|---|---|
committer | unknown <ram@gw.mysql.r18.ru> | 2004-11-25 16:18:48 +0400 |
commit | 207676814b6f464441498e95ad809498a2948130 (patch) | |
tree | 13652b16beb3ad7ca204ab012588172c5f23918e | |
parent | 26339663b87159075a37899f05231aedefa61d2e (diff) | |
parent | 026259249e716fad2923218055afdb32c1ea3776 (diff) | |
download | mariadb-git-207676814b6f464441498e95ad809498a2948130.tar.gz |
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into gw.mysql.r18.ru:/usr/home/ram/work/4.1.b6441
-rw-r--r-- | sql/item_func.cc | 19 | ||||
-rw-r--r-- | sql/item_sum.h | 2 | ||||
-rw-r--r-- | sql/sql_udf.h | 3 |
3 files changed, 14 insertions, 10 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index 3fb5bcd01c6..32841ba447b 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1602,18 +1602,21 @@ longlong Item_func_bit_count::val_int() udf_handler::~udf_handler() { - if (initialized) + if (!not_original) { - if (u_d->func_deinit != NULL) + if (initialized) { - void (*deinit)(UDF_INIT *) = (void (*)(UDF_INIT*)) - u_d->func_deinit; - (*deinit)(&initid); + if (u_d->func_deinit != NULL) + { + void (*deinit)(UDF_INIT *) = (void (*)(UDF_INIT*)) + u_d->func_deinit; + (*deinit)(&initid); + } + free_udf(u_d); } - free_udf(u_d); + if (buffers) // Because of bug in ecc + delete [] buffers; } - if (buffers) // Because of bug in ecc - delete [] buffers; } diff --git a/sql/item_sum.h b/sql/item_sum.h index f9c48304795..521c595712b 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -531,7 +531,7 @@ public: :Item_sum( list ), udf(udf_arg) { quick_group=0;} Item_udf_sum(THD *thd, Item_udf_sum *item) - :Item_sum(thd, item), udf(item->udf) {} + :Item_sum(thd, item), udf(item->udf) { udf.not_original= TRUE; } const char *func_name() const { return udf.name(); } bool fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) { diff --git a/sql/sql_udf.h b/sql/sql_udf.h index 7b10b80f148..d1f99a6d232 100644 --- a/sql/sql_udf.h +++ b/sql/sql_udf.h @@ -56,8 +56,9 @@ class udf_handler :public Sql_alloc public: table_map used_tables_cache; bool const_item_cache; + bool not_original; udf_handler(udf_func *udf_arg) :u_d(udf_arg), buffers(0), error(0), - is_null(0), initialized(0) + is_null(0), initialized(0), not_original(0) {} ~udf_handler(); const char *name() const { return u_d ? u_d->name.str : "?"; } |