mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Made stored FUNCTION invokation work almost always. Still buggy and unstable, and
various known problems, but good enough for a checkpoint commit. mysql-test/r/sp.result: New tests for invoking simple FUNCTIONs. mysql-test/t/sp.test: New tests for invoking simple FUNCTIONs. sql/item_func.cc: New Item_func_sp for stored FUNCTIONs. sql/item_func.h: New Item_func_sp for stored FUNCTIONs. sql/sp.cc: Close mysql.proc table earlier so recursive find_function calls work. Added temporary sp_function_exists() function for checking without parsing. sql/sp.h: Added temporary sp_function_exists() function for checking without parsing. sql/sp_head.cc: New code for executing a FUNCTION. (And reworked some of the old code in the process.) sql/sp_head.h: New code for executing a FUNCTION. sql/sp_rcontext.h: Added result slot for FUNCTIONs. sql/sql_lex.cc: Added check for stored FUNCTION, analogous to UDFs. sql/sql_parse.cc: sp_head::execute was renamed into execute_procedure. sql/sql_yacc.yy: Added parsing of stored FUNCTION invocation and code generation for RETURN statement.
This commit is contained in:
@@ -2959,6 +2959,7 @@ mysql_execute_command(THD *thd)
|
||||
{
|
||||
uint namelen;
|
||||
char *name= lex->sphead->name(&namelen);
|
||||
#ifdef HAVE_DLOPEN
|
||||
udf_func *udf = find_udf(name, namelen);
|
||||
|
||||
if (udf)
|
||||
@@ -2966,6 +2967,7 @@ mysql_execute_command(THD *thd)
|
||||
net_printf(thd, ER_UDF_EXISTS, name);
|
||||
goto error;
|
||||
}
|
||||
#endif
|
||||
res= lex->sphead->create(thd);
|
||||
switch (res)
|
||||
{
|
||||
@@ -3000,7 +3002,7 @@ mysql_execute_command(THD *thd)
|
||||
|
||||
thd->net.no_send_ok= TRUE;
|
||||
#endif
|
||||
res= sp->execute(thd);
|
||||
res= sp->execute_procedure(thd, &lex->value_list);
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
thd->net.no_send_ok= nsok;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user