A "subroutine" refers to any statement or block of statements that is defined but may not be immediately executed. MySQL has six types of subroutines:
CREATE PROCEDURE
CREATE FUNCTION
CREATE TRIGGER
CREATE EVENT
CREATE TABLE AS
CREATE VIEW AS
Dolt has all of these except functions.
Nesting these constructs is allowed in some cases but not others. Prior to fixing https://github.com/dolthub/dolt/issues/8028, attempting to nest these constructs caused a panic. Now, while there is no panic, our behavior does not necessarily match MySQL
In cases where both Dolt and MySQL return an error, Dolt's error message should match MySQL.
In cases where Dolt returns an error but MySQL doesn't, we should match MySQL's behavior.
In cases where MySQL returns an error but Dolt doesn't, we should either match MySQL, or add additional tests to verify that our behavior is sensible.
A "subroutine" refers to any statement or block of statements that is defined but may not be immediately executed. MySQL has six types of subroutines:
CREATE PROCEDURE
CREATE FUNCTION
CREATE TRIGGER
CREATE EVENT
CREATE TABLE AS
CREATE VIEW AS
Dolt has all of these except functions.
Nesting these constructs is allowed in some cases but not others. Prior to fixing https://github.com/dolthub/dolt/issues/8028, attempting to nest these constructs caused a panic. Now, while there is no panic, our behavior does not necessarily match MySQL
In cases where both Dolt and MySQL return an error, Dolt's error message should match MySQL.
In cases where Dolt returns an error but MySQL doesn't, we should match MySQL's behavior.
In cases where MySQL returns an error but Dolt doesn't, we should either match MySQL, or add additional tests to verify that our behavior is sensible.