<p>I have a fix for it but it's a bit verbose. It uses Regexp::Common::balanced to only do the comma split on portions of strings that do not contain balanced parentheses.</p>
<pre><code>diff --git a/lib/SQL/Translator/Utils.pm b/lib/SQL/Translator/Utils.pm
index ccc7ad3..ed3c966 100644
--- a/lib/SQL/Translator/Utils.pm
+++ b/lib/SQL/Translator/Utils.pm
@@ -124,24 +124,52 @@ HEADER_COMMENT
     return $header_comment;
 }
 
-sub parse_list_arg {
-    my $list = UNIVERSAL::isa( $_[0], 'ARRAY' ) ? shift : [ @_ ];
-
-    #
-    # This protects stringification of references.
-    #
-    if ( @$list &amp;&amp; ref $list-&gt;[0] ) {
-        return $list;
+{
+    use Regexp::Common qw/ balanced /; # included here to make the patch easier to read
+
+    # declare variabled shared in this scope
+    my @chars = ('a'..'z', 'A'..'Z', '_', '-', 0..9);
+    my %symbols;
+
+    sub save_string {
+        my ($str) = @_;
+        my $sym;
+        # iterate on the off chance that our random string isn't unique
+        do {  $sym = "STRING_" . join '', map { $chars[rand(@chars)] } 0..15; }
+          while exists $symbols{$sym};
+        $symbols{$sym} = $str;
+        return $sym
     }
-    #
-    # This processes string-like arguments.
-    #
-    else {
-        return [
-            map { s/^\s+|\s+$//g; $_ }
-            map { split /,/ }
-            grep { defined &amp;&amp; length } @$list
-        ];
+
+    sub restore_strings {
+        for my $re (keys %symbols) {
+            $_[0] =~ s/($re)/$symbols{$1}/g;
+        }
+    }
+
+    sub clear_saved_strings {
+        %symbols = ();
+    }
+
+    sub parse_list_arg {
+        my $list = UNIVERSAL::isa( $_[0], 'ARRAY' ) ? shift : [ @_ ];
+        #
+        # This protects stringification of references.
+        #
+        if ( @$list &amp;&amp; ref $list-&gt;[0] ) {
+            return $list;
+        }
+        #
+        # This processes string-like arguments.
+        #
+        else {
+          clear_saved_strings(); # start fresh each time
+          return [
+              map { restore_strings($_); s/^\s+|\s+$//g; $_ }
+              map { $_ =~ s/$RE{balanced}{-parens=&gt;'()'}/save_string($1)/ge; split /,/ }
+              grep { defined &amp;&amp; length } @$list
+          ];
+        }
     }
 }
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/dbsrgits/sql-translator/issues/83#issuecomment-266055940">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AASeAuFzz3uVH56YNDLZ3JH_AoFfvOKhks5rGYDxgaJpZM4LIYEz">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AASeAu3_eebP1s9-ClSbBL1HGmeRGRpAks5rGYDxgaJpZM4LIYEz.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/dbsrgits/sql-translator/issues/83#issuecomment-266055940"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/dbsrgits/sql-translator","title":"dbsrgits/sql-translator","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/dbsrgits/sql-translator"}},"updates":{"snippets":[{"icon":"PERSON","message":"@mrmuskrat in #83: I have a fix for it but it's a bit verbose. It uses Regexp::Common::balanced to only do the comma split on portions of strings that do not contain balanced parentheses.\r\n```\r\ndiff --git a/lib/SQL/Translator/Utils.pm b/lib/SQL/Translator/Utils.pm\r\nindex ccc7ad3..ed3c966 100644\r\n--- a/lib/SQL/Translator/Utils.pm\r\n+++ b/lib/SQL/Translator/Utils.pm\r\n@@ -124,24 +124,52 @@ HEADER_COMMENT\r\n     return $header_comment;\r\n }\r\n \r\n-sub parse_list_arg {\r\n-    my $list = UNIVERSAL::isa( $_[0], 'ARRAY' ) ? shift : [ @_ ];\r\n-\r\n-    #\r\n-    # This protects stringification of references.\r\n-    #\r\n-    if ( @$list \u0026\u0026 ref $list-\u003e[0] ) {\r\n-        return $list;\r\n+{\r\n+    use Regexp::Common qw/ balanced /; # included here to make the patch easier to read\r\n+\r\n+    # declare variabled shared in this scope\r\n+    my @chars = ('a'..'z', 'A'..'Z', '_', '-', 0..9);\r\n+    my %symbols;\r\n+\r\n+    sub save_string {\r\n+        my ($str) = @_;\r\n+        my $sym;\r\n+        # iterate on the off chance that our random string isn't unique\r\n+        do {  $sym = \"STRING_\" . join '', map { $chars[rand(@chars)] } 0..15; }\r\n+          while exists $symbols{$sym};\r\n+        $symbols{$sym} = $str;\r\n+        return $sym\r\n     }\r\n-    #\r\n-    # This processes string-like arguments.\r\n-    #\r\n-    else {\r\n-        return [\r\n-            map { s/^\\s+|\\s+$//g; $_ }\r\n-            map { split /,/ }\r\n-            grep { defined \u0026\u0026 length } @$list\r\n-        ];\r\n+\r\n+    sub restore_strings {\r\n+        for my $re (keys %symbols) {\r\n+            $_[0] =~ s/($re)/$symbols{$1}/g;\r\n+        }\r\n+    }\r\n+\r\n+    sub clear_saved_strings {\r\n+        %symbols = ();\r\n+    }\r\n+\r\n+    sub parse_list_arg {\r\n+        my $list = UNIVERSAL::isa( $_[0], 'ARRAY' ) ? shift : [ @_ ];\r\n+        #\r\n+        # This protects stringification of references.\r\n+        #\r\n+        if ( @$list \u0026\u0026 ref $list-\u003e[0] ) {\r\n+            return $list;\r\n+        }\r\n+        #\r\n+        # This processes string-like arguments.\r\n+        #\r\n+        else {\r\n+          clear_saved_strings(); # start fresh each time\r\n+          return [\r\n+              map { restore_strings($_); s/^\\s+|\\s+$//g; $_ }\r\n+              map { $_ =~ s/$RE{balanced}{-parens=\u003e'()'}/save_string($1)/ge; split /,/ }\r\n+              grep { defined \u0026\u0026 length } @$list\r\n+          ];\r\n+        }\r\n     }\r\n }\r\n ```"}],"action":{"name":"View Issue","url":"https://github.com/dbsrgits/sql-translator/issues/83#issuecomment-266055940"}}}</script>