A.4.13. Do stored procedures provide exception handling? 

MySQL implements HANDLER  definitions according to the SQL standard. See Section 13.6.7.2, “DECLARE ... HANDLER Statement” , for details. 

A.4.14. Can MySQL 8.0 stored routines return result sets? 

Stored procedures  can, but stored functions cannot. If you perform an ordinary SELECT  inside a stored procedure, the result set is returned directly to the client. You need to use the MySQL 4.1 (or higher) client/server protocol for this to work. This means that, for example, in PHP, you need to use the mysqli  extension rather than the old mysql  extension. 

A.4.15. Is WITH RECOMPILE  supported for stored procedures? 

Not in MySQL 8.0. 

A.4.16. Is there a MySQL equivalent to using mod_plsql  as a gateway on Apache to talk directly to a stored procedure in the database? 

A.4.17. Can I pass an array as input to a stored procedure? 

A.4.18. Can I pass a cursor as an IN  parameter to a stored procedure? 

A.4.19. Can I return a cursor as an OUT  parameter from a stored procedure? 

There is no equivalent in MySQL 8.0. 

Not in MySQL 8.0. 

In MySQL 8.0, cursors are available inside stored procedures only. 

In MySQL 8.0, cursors are available inside stored procedures only. However, if you do not open a cursor on a SELECT , the result is sent directly to the client. You can also SELECT INTO  variables. See Section 13.2.10, “SELECT Statement” . 

A.4.20. Can I print out a variable’s value within a stored routine for debugging purposes? 

Yes, you can do this in a stored procedure , but not in a stored function. If you perform an ordinary SELECT  inside a stored procedure, the result set is returned directly to the client. You must use the MySQL 4.1 (or above) client/server protocol for this to work. This means that, for example, in PHP, you need to use the mysqli  extension rather than the old mysql  extension. 

A.4.21. Can I commit or roll back transactions inside a stored procedure? 

Yes. However, you cannot perform transactional operations within a stored function. 

A.4.22. Do MySQL 8.0 stored procedures and functions work with replication? 

Yes, standard actions carried out in stored procedures and functions are replicated from a replication source server to a replica. There are a few limitations that are described in detail in Section 25.7, “Stored Program Binary Logging” . 

A.4.23. Are stored procedures and functions created on a replication source server replicated to a replica? 

Yes, creation of stored procedures and functions carried out through normal DDL statements on a replication source server are replicated to a replica, so that the objects exist on both servers. ALTER and DROP  statements for stored procedures and functions are also replicated. 

A.4.24. How are actions that take place inside stored procedures and functions replicated? 

