dolthub / dolt

Dolt – Git for Data
Apache License 2.0
17.41k stars 488 forks source link

Match MySQL's handling of nested subroutine definitions. #8053

Open nicktobey opened 3 weeks ago

nicktobey commented 3 weeks ago

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:

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