From: Arthur Axel 'fREW' Schmidt Date: Sat, 20 Mar 2010 16:56:15 +0000 (-0500) Subject: general cleanup and regex fixes so that COMMITs actually get filtered out X-Git-Tag: v0.001000_01~85 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cf80d86de4e3e77bca8562473742c7a393753c13;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git general cleanup and regex fixes so that COMMITs actually get filtered out --- diff --git a/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm b/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm index 1204e4d..e0b93bc 100644 --- a/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm +++ b/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm @@ -205,8 +205,9 @@ sub _deploy { #< frew> so we have txn_wrap default to true #< frew> and if people wanna do that by hand they can my $sql = $self->_deployment_statements(); - foreach my $line ( split(";\n", $sql)) { - next if !$line || $line =~ /^--|^BEGIN TRANSACTION|^COMMIT|^\s+$/; + foreach my $line ( split(/;\n/, $sql)) { + $line = join '', grep { !/^--/ } split /\n/, $line; + next if !$line || $line =~ /^BEGIN TRANSACTION|^COMMIT|^\s+$/; $storage->_query_start($line); try { # do a dbh_do cycle here, as we need some error checking in