summaryrefslogtreecommitdiff
path: root/sql/sql_udf.cc
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2003-08-27 22:30:50 +0300
committerunknown <monty@narttu.mysql.fi>2003-08-27 22:30:50 +0300
commit0ee6f7fde0c5737b2a0b703b1c2755186d7d319b (patch)
tree20979ee2d8e2b0c2cb5d979c17fcb2a620ae17a1 /sql/sql_udf.cc
parent91dc31d38334cddc0b47c9ac0c0be338fc8cfd20 (diff)
downloadmariadb-git-0ee6f7fde0c5737b2a0b703b1c2755186d7d319b.tar.gz
hanged UDF interface to use clear() instead of reset()
BUILD/FINISH.sh: Add just_clean option (for cleanup script) scripts/mysql_fix_privilege_tables.sql: Added 'USE mysql' for easer use on windows sql/item_sum.cc: Changed UDF interface to use clear() instead of reset() sql/item_sum.h: Changed UDF interface to use clear() instead of reset() sql/slave.cc: Fixed checking of eof for slave/master protocol. (Bug #887) sql/sql_udf.cc: Changed UDF interface to use clear() instead of reset() sql/sql_udf.h: Changed UDF interface to use clear() instead of reset() sql/sql_yacc.yy: ERRORS and WARNINGS should not be reserved words sql/udf_example.cc: Changed UDF interface to use clear() instead of reset()
Diffstat (limited to 'sql/sql_udf.cc')
-rw-r--r--sql/sql_udf.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc
index d191550f396..99410bb34ac 100644
--- a/sql/sql_udf.cc
+++ b/sql/sql_udf.cc
@@ -92,10 +92,13 @@ static void init_syms(udf_func *tmp)
tmp->func_deinit = dlsym(tmp->dlhandle, nm);
if (tmp->type == UDFTYPE_AGGREGATE)
{
- (void)strmov( end, "_reset" );
- tmp->func_reset = dlsym( tmp->dlhandle, nm );
+ (void)strmov( end, "_clear" );
+ tmp->func_clear = dlsym( tmp->dlhandle, nm );
(void)strmov( end, "_add" );
tmp->func_add = dlsym( tmp->dlhandle, nm );
+ /* Give error if _clear and _add doesn't exists */
+ if (!tmp->func_clear || ! tmp->func_add)
+ tmp->func= 0;
}
}
@@ -417,7 +420,7 @@ int mysql_create_function(THD *thd,udf_func *udf)
u_d->func=udf->func;
u_d->func_init=udf->func_init;
u_d->func_deinit=udf->func_deinit;
- u_d->func_reset=udf->func_reset;
+ u_d->func_clear=udf->func_clear;
u_d->func_add=udf->func_add;
/* create entry in mysql/func table */
@@ -429,7 +432,7 @@ int mysql_create_function(THD *thd,udf_func *udf)
if (!(table = open_ltable(thd,&tables,TL_WRITE)))
goto err;
- restore_record(table,default_values); // Get default values for fields
+ restore_record(table,default_values); // Default values for fields
table->field[0]->store(u_d->name.str, u_d->name.length, system_charset_info);
table->field[1]->store((longlong) u_d->returns);
table->field[2]->store(u_d->dl,(uint) strlen(u_d->dl), system_charset_info);