From: Chris Hilton Date: Mon, 19 Feb 2007 23:35:27 +0000 (+0000) Subject: Tweak previous comment parsing tweak for multiple lines X-Git-Tag: v0.11008~384 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=da9f2af80f613109141d600f5c876cd705feaa8b;p=dbsrgits%2FSQL-Translator.git Tweak previous comment parsing tweak for multiple lines --- diff --git a/lib/SQL/Translator/Parser/MySQL.pm b/lib/SQL/Translator/Parser/MySQL.pm index 1a565fa..ffc178b 100644 --- a/lib/SQL/Translator/Parser/MySQL.pm +++ b/lib/SQL/Translator/Parser/MySQL.pm @@ -1,7 +1,7 @@ package SQL::Translator::Parser::MySQL; # ------------------------------------------------------------------- -# $Id: MySQL.pm,v 1.56 2007-02-19 20:15:13 duality72 Exp $ +# $Id: MySQL.pm,v 1.57 2007-02-19 23:35:27 duality72 Exp $ # ------------------------------------------------------------------- # Copyright (C) 2002-4 SQLFairy Authors # @@ -134,7 +134,7 @@ A subset of INSERT that we ignore: use strict; use vars qw[ $DEBUG $VERSION $GRAMMAR @EXPORT_OK ]; -$VERSION = sprintf "%d.%02d", q$Revision: 1.56 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.57 $ =~ /(\d+)\.(\d+)/; $DEBUG = 0 unless defined $DEBUG; use Data::Dumper; @@ -309,7 +309,7 @@ comment : /^\s*(?:#|-{2}).*\n/ $return = $comment; } -comment : /\/\*/ /.*?\*\// +comment : /\/\*/ /.*?\*\//s { my $comment = $item[2]; $comment = substr($comment, 0, -2); diff --git a/t/02mysql-parser.t b/t/02mysql-parser.t index 980fa7f..ea3a7e1 100644 --- a/t/02mysql-parser.t +++ b/t/02mysql-parser.t @@ -481,7 +481,10 @@ BEGIN { q[ DELIMITER ;; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;; - /*!50003 CREATE */ /*!50017 DEFINER=`cmdomain`@`localhost` */ /*!50003 TRIGGER `acl_entry_insert` BEFORE INSERT ON `acl_entry` FOR EACH ROW SET NEW.dateCreated = CONVERT_TZ(SYSDATE(),'SYSTEM','+0:00'), NEW.dateModified = CONVERT_TZ(SYSDATE(),'SYSTEM','+0:00') */;; + /*!50003 CREATE */ /*!50017 DEFINER=`cmdomain`@`localhost` */ + /*!50003 TRIGGER `acl_entry_insert` BEFORE INSERT ON `acl_entry` + FOR EACH ROW SET NEW.dateCreated = CONVERT_TZ(SYSDATE(),'SYSTEM','+0:00'), + NEW.dateModified = CONVERT_TZ(SYSDATE(),'SYSTEM','+0:00') */;; DELIMITER ; CREATE TABLE one (