<?xml version='1.0' encoding='UTF-8'?>
<!--
  ~ Copyright (c) DbVis Software AB. All Rights Reserved.
  -->
<sql:Dialect tag="mysql" xmlns:sql="http://dbvis.com/sql-dialect.xsd" comment="Similar to MariaDB dialect" references="
   https://dev.mysql.com/doc/refman/8.0/en/create-procedure.html
   https://dev.mysql.com/doc/refman/8.0/en/trigger-syntax.html, 
   https://dev.mysql.com/doc/refman/8.0/en/begin-end.html
   https://dev.mysql.com/doc/refman/8.0/en/flow-control-statements.html
   
">
  <!-- MariaDB apparently supports "OR REPLACE", but not MySQL -->
   <sql:ComplexStatement begin="CREATE {FUNCTION | PROCEDURE | TRIGGER}" end="" end.override="false">
     <sql:Directive begin="DEFINER = '" end="'"/>
     <sql:Directive begin="@'" end="'"                comment="TODO: Kludge, added to support DEFINER='admin'@'localhost'"/>

     <sql:InnerStatement begin="IF" end="END IF"/>
     <sql:InnerStatement begin="BEGIN" end="END"/>
     <sql:InnerStatement begin="CASE" end="END CASE"/>
     <sql:InnerStatement begin="LOOP" end="END LOOP"/>
     <sql:InnerStatement begin="REPEAT" end="END REPEAT"/>
     <sql:InnerStatement begin="WHILE" end="END WHILE"/>
  </sql:ComplexStatement>

</sql:Dialect>