From: Marc Mims Date: Fri, 5 Mar 2010 16:53:59 +0000 (+0000) Subject: fixed open outer parens in a multi-line literal X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=171a709f3628dad4f66300a49a1340ac41498730;p=scpubgit%2FQ-Branch.git fixed open outer parens in a multi-line literal --- diff --git a/Changes b/Changes index 9a93a2c..0cfb830 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ Revision history for SQL::Abstract + - fixed open outer parens for a multi-line literal + revision 1.61 2010-02-05 16:28 (UTC) ---------------------------- - Allow INSERT to take additional attributes diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index ec8cbff..58f99cc 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -928,7 +928,7 @@ sub _where_field_IN { # adding them back in the corresponding method sub _open_outer_paren { my ($self, $sql) = @_; - $sql = $1 while $sql =~ /^ \s* \( (.*) \) \s* $/x; + $sql = $1 while $sql =~ /^ \s* \( (.*) \) \s* $/xs; return $sql; } diff --git a/t/05in_between.t b/t/05in_between.t index bf32375..ff6b738 100644 --- a/t/05in_between.t +++ b/t/05in_between.t @@ -115,6 +115,16 @@ my @in_between_tests = ( { parenthesis_significant => 1, where => { + status => { -in => \"(SELECT status_codes\nFROM states)" }, + }, + # failed to open outer parens on a multi-line query in 1.61 (semifor) + stmt => " WHERE ( status IN ( SELECT status_codes FROM states )) ", + bind => [], + test => '-in multi-line subquery test', + }, + { + parenthesis_significant => 1, + where => { customer => { -in => \[ 'SELECT cust_id FROM cust WHERE balance > ?', 2000,