diff options
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r-- | sql/sql_prepare.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index a71b8148f8e..fddf95327d6 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1541,9 +1541,11 @@ static int check_prepared_statement(Prepared_statement *stmt, if (lex->sql_command != SQLCOM_CREATE_PROCEDURE && lex->sql_command != SQLCOM_CREATE_SPFUNCTION) { - /* the error is print inside */ - if (sp_cache_functions(thd, lex)) - DBUG_RETURN(1); + /* The error is printed inside */ + if (sp_cache_routines(thd, lex, TYPE_ENUM_FUNCTION)) + DBUG_RETURN(-1); + if (sp_cache_routines(thd, lex, TYPE_ENUM_PROCEDURE)) + DBUG_RETURN(-1); } switch (sql_command) { |