Commit 43853e19 authored by unknown's avatar unknown

Manual merge of fix for bug #9913 into 5.0 tree.


mysql-test/t/range.test:
  Auto merged
scripts/mysql_install_db.sh:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_sum.h:
  Auto merged
sql/sql_udf.h:
  Auto merged
mysql-test/r/mysqldump.result:
  Manual merge.
mysql-test/t/mysqldump.test:
  Manual merge.
parents c4574a62 b1a8433a
...@@ -24,7 +24,7 @@ pkginclude_HEADERS = readline/readline.h ...@@ -24,7 +24,7 @@ pkginclude_HEADERS = readline/readline.h
noinst_HEADERS = chared.h el.h el_term.h histedit.h key.h parse.h refresh.h sig.h \ noinst_HEADERS = chared.h el.h el_term.h histedit.h key.h parse.h refresh.h sig.h \
sys.h tokenizer.h config.h hist.h map.h prompt.h read.h \ sys.h tokenizer.h config.h hist.h map.h prompt.h read.h \
search.h tty.h libedit_term.h search.h tty.h libedit_term.h vis.h
EXTRA_DIST = makelist.sh np/unvis.c np/strlcpy.c np/vis.c np/vis.h np/strlcat.c np/fgetln.c EXTRA_DIST = makelist.sh np/unvis.c np/strlcpy.c np/vis.c np/vis.h np/strlcat.c np/fgetln.c
......
-- source include/have_innodb.inc
# #
# Problem with range optimizer # Problem with range optimizer
# #
......
...@@ -11,7 +11,6 @@ in_rpm=0 ...@@ -11,7 +11,6 @@ in_rpm=0
windows=0 windows=0
defaults="" defaults=""
user="" user=""
tmp_file=/tmp/mysql_install_db.$$
case "$1" in case "$1" in
--no-defaults|--defaults-file=*|--defaults-extra-file=*) --no-defaults|--defaults-file=*|--defaults-extra-file=*)
...@@ -223,10 +222,8 @@ then ...@@ -223,10 +222,8 @@ then
then then
echo "Fill help tables" echo "Fill help tables"
fi fi
echo "use mysql;" > $tmp_file (echo "use mysql;"; cat $fill_help_tables) | eval "$mysqld_install_cmd_line"
cat $tmp_file $fill_help_tables | eval "$mysqld_install_cmd_line"
res=$? res=$?
rm $tmp_file
if test $res != 0 if test $res != 0
then then
echo "" echo ""
......
...@@ -2533,6 +2533,28 @@ longlong Item_func_bit_count::val_int() ...@@ -2533,6 +2533,28 @@ longlong Item_func_bit_count::val_int()
#ifdef HAVE_DLOPEN #ifdef HAVE_DLOPEN
void udf_handler::cleanup()
{
if (!not_original)
{
if (initialized)
{
if (u_d->func_deinit != NULL)
{
void (*deinit)(UDF_INIT *) = (void (*)(UDF_INIT*))
u_d->func_deinit;
(*deinit)(&initid);
}
free_udf(u_d);
initialized= FALSE;
}
if (buffers) // Because of bug in ecc
delete [] buffers;
buffers= 0;
}
}
bool bool
udf_handler::fix_fields(THD *thd, TABLE_LIST *tables, Item_result_field *func, udf_handler::fix_fields(THD *thd, TABLE_LIST *tables, Item_result_field *func,
uint arg_count, Item **arguments) uint arg_count, Item **arguments)
...@@ -2805,6 +2827,13 @@ my_decimal *udf_handler::val_decimal(my_bool *null_value, my_decimal *dec_buf) ...@@ -2805,6 +2827,13 @@ my_decimal *udf_handler::val_decimal(my_bool *null_value, my_decimal *dec_buf)
} }
void Item_udf_func::cleanup()
{
udf.cleanup();
Item_func::cleanup();
}
double Item_func_udf_float::val_real() double Item_func_udf_float::val_real()
{ {
DBUG_ASSERT(fixed == 1); DBUG_ASSERT(fixed == 1);
...@@ -2930,21 +2959,8 @@ String *Item_func_udf_str::val_str(String *str) ...@@ -2930,21 +2959,8 @@ String *Item_func_udf_str::val_str(String *str)
udf_handler::~udf_handler() udf_handler::~udf_handler()
{ {
if (!not_original) /* Everything should be properly cleaned up by this moment. */
{ DBUG_ASSERT(not_original || !(initialized || buffers));
if (initialized)
{
if (u_d->func_deinit != NULL)
{
void (*deinit)(UDF_INIT *) = (void (*)(UDF_INIT*))
u_d->func_deinit;
(*deinit)(&initid);
}
free_udf(u_d);
}
if (buffers) // Because of bug in ecc
delete [] buffers;
}
} }
#else #else
......
...@@ -879,6 +879,7 @@ class Item_udf_func :public Item_func ...@@ -879,6 +879,7 @@ class Item_udf_func :public Item_func
fixed= 1; fixed= 1;
return res; return res;
} }
void cleanup();
Item_result result_type () const { return udf.result_type(); } Item_result result_type () const { return udf.result_type(); }
table_map not_null_tables() const { return 0; } table_map not_null_tables() const { return 0; }
}; };
......
...@@ -2456,6 +2456,17 @@ bool Item_udf_sum::add() ...@@ -2456,6 +2456,17 @@ bool Item_udf_sum::add()
DBUG_RETURN(0); DBUG_RETURN(0);
} }
void Item_udf_sum::cleanup()
{
/*
udf_handler::cleanup() nicely handles case when we have not
original item but one created by copy_or_same() method.
*/
udf.cleanup();
Item_sum::cleanup();
}
Item *Item_sum_udf_float::copy_or_same(THD* thd) Item *Item_sum_udf_float::copy_or_same(THD* thd)
{ {
return new (thd->mem_root) Item_sum_udf_float(thd, this); return new (thd->mem_root) Item_sum_udf_float(thd, this);
......
...@@ -667,6 +667,7 @@ class Item_udf_sum : public Item_sum ...@@ -667,6 +667,7 @@ class Item_udf_sum : public Item_sum
bool add(); bool add();
void reset_field() {}; void reset_field() {};
void update_field() {}; void update_field() {};
void cleanup();
}; };
......
...@@ -67,6 +67,7 @@ class udf_handler :public Sql_alloc ...@@ -67,6 +67,7 @@ class udf_handler :public Sql_alloc
bool get_arguments(); bool get_arguments();
bool fix_fields(THD *thd,struct st_table_list *tlist,Item_result_field *item, bool fix_fields(THD *thd,struct st_table_list *tlist,Item_result_field *item,
uint arg_count,Item **args); uint arg_count,Item **args);
void cleanup();
double val(my_bool *null_value) double val(my_bool *null_value)
{ {
if (get_arguments()) if (get_arguments())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment