Compound statements in MariaDB can be used both inside and outside (starting from MariaDB 10.1.1) of stored programs.