Bumping version to 1.59_01
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Parser / MySQL.pm
index 8cdd794..8c3e81a 100644 (file)
@@ -132,7 +132,7 @@ More information about the MySQL comment-syntax: L<http://dev.mysql.com/doc/refm
 use strict;
 use warnings;
 
-our $VERSION = '1.59';
+our $VERSION = '1.59_01';
 
 our $DEBUG;
 $DEBUG   = 0 unless defined $DEBUG;
@@ -476,12 +476,9 @@ field_comment : /^\s*(?:#|-{2}).*\n/
     }
 
 
-field_comment2 : /comment/i SQSTRING
-    { $return = $item[2] }
-
 blank : /\s*/
 
-field : field_comment(s?) field_name data_type field_qualifier(s?) field_comment2(?) reference_definition(?) on_update(?) field_comment(s?)
+field : field_comment(s?) field_name data_type field_qualifier(s?) reference_definition(?) on_update(?) field_comment(s?)
     {
         my %qualifiers  = map { %$_ } @{ $item{'field_qualifier(s?)'} || [] };
         if ( my @type_quals = @{ $item{'data_type'}{'qualifiers'} || [] } ) {
@@ -492,7 +489,7 @@ field : field_comment(s?) field_name data_type field_qualifier(s?) field_comment
                    ? $qualifiers{'not_null'} : 1;
         delete $qualifiers{'not_null'};
 
-        my @comments = ( @{ $item[1] }, @{ $item[5] }, @{ $item[8] } );
+        my @comments = ( @{ $item[1] }, (exists $qualifiers{comment} ? delete $qualifiers{comment} : ()) , @{ $item[7] } );
 
         $return = {
             supertype   => 'field',
@@ -578,6 +575,13 @@ field_qualifier : KEY
         }
     }
 
+field_qualifier : /comment/i string
+    {
+        $return = {
+            comment => $item[2],
+        }
+    }
+
 reference_definition : /references/i table_name parens_field_list(?) match_type(?) on_delete(?) on_update(?)
     {
         $return = {