diff --git a/pegjs/mariadb.pegjs b/pegjs/mariadb.pegjs index b6b0d69c..246a0977 100644 --- a/pegjs/mariadb.pegjs +++ b/pegjs/mariadb.pegjs @@ -1350,7 +1350,7 @@ show_stmt } }; } - / KW_SHOW __ KW_CREATE __ k:(KW_VIEW / KW_TABLE) __ t:table_name { + / KW_SHOW __ KW_CREATE __ k:(KW_VIEW / KW_TABLE / 'EVENT'i / KW_TRIGGER / 'PROCEDURE'i) __ t:table_name { const suffix = k.toLowerCase() return { tableList: Array.from(tableList), diff --git a/pegjs/mysql.pegjs b/pegjs/mysql.pegjs index e5e16426..e57b3075 100644 --- a/pegjs/mysql.pegjs +++ b/pegjs/mysql.pegjs @@ -1656,7 +1656,7 @@ show_stmt } }; } - / KW_SHOW __ KW_CREATE __ k:(KW_VIEW / KW_TABLE) __ t:table_name { + / KW_SHOW __ KW_CREATE __ k:(KW_VIEW / KW_TABLE / 'EVENT'i / KW_TRIGGER / 'PROCEDURE'i) __ t:table_name { const suffix = k.toLowerCase() return { tableList: Array.from(tableList), diff --git a/test/mysql-mariadb.spec.js b/test/mysql-mariadb.spec.js index 2e5bee70..8ba34521 100644 --- a/test/mysql-mariadb.spec.js +++ b/test/mysql-mariadb.spec.js @@ -342,6 +342,20 @@ describe('mysql', () => { 'SHOW CREATE VIEW `abc`.`test`' ] }, + { + title: 'show create event', + sql: [ + 'SHOW CREATE EVENT `monthly_gc`', + 'SHOW CREATE EVENT `monthly_gc`' + ] + }, + { + title: 'show create procedure', + sql: [ + 'SHOW CREATE PROCEDURE get_jails', + 'SHOW CREATE PROCEDURE `get_jails`' + ] + }, { title: 'with', sql: [