From: Ed J Date: Sat, 7 Mar 2020 20:16:24 +0000 (+0000) Subject: MariaDB allows defaults of column names X-Git-Tag: v1.61~10 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=70aafeedd6733a3a8e17d90f86b66c62663438e5;p=dbsrgits%2FSQL-Translator.git MariaDB allows defaults of column names --- diff --git a/lib/SQL/Translator/Parser/MySQL.pm b/lib/SQL/Translator/Parser/MySQL.pm index c3a60bb..eedf583 100644 --- a/lib/SQL/Translator/Parser/MySQL.pm +++ b/lib/SQL/Translator/Parser/MySQL.pm @@ -692,6 +692,11 @@ default_val : { $return = $item[2]; } + | + /default/i NAME # column value, allowed in MariaDB + { + $return = $item[2]; + } auto_inc : /auto_increment/i { 1 } diff --git a/t/data/mysql/create.sql b/t/data/mysql/create.sql index 64ab685..e13eab0 100644 --- a/t/data/mysql/create.sql +++ b/t/data/mysql/create.sql @@ -4,7 +4,7 @@ create table person ( age integer, weight double(11,2), iq tinyint default '0', - description text, + description text default `name`, UNIQUE KEY UC_age_name (age) ) ENGINE=MyISAM;