X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FResultSet.pm;fp=lib%2FDBIx%2FClass%2FResultSet.pm;h=c82711a68a99da99226393ca4769fb40742e846f;hb=140873ef6dc1877d09fdca235994185504c2f8da;hp=9a478e4a1e01b463fca5b9d6fcf8a72fd1105cf6;hpb=004b0a974d388f1329bbe7df5624df10bf5adff3;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 9a478e4..c82711a 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -1730,7 +1730,8 @@ sub _count_subq_rs { $sql_maker->{name_sep} = ''; } - my ($lquote, $rquote, $sep) = map { quotemeta $_ } ($sql_maker->_quote_chars, $sql_maker->name_sep); + my $sep = quotemeta($sql_maker->name_sep); + my $ident_re = $sql_maker->_quoted_ident_re; my $having_sql = $sql_maker->_parse_rs_attrs ({ having => $attrs->{having} }); my %seen_having; @@ -1738,13 +1739,13 @@ sub _count_subq_rs { # search for both a proper quoted qualified string, for a naive unquoted scalarref # and if all fails for an utterly naive quoted scalar-with-function while ($having_sql =~ / - $rquote $sep $lquote (.+?) $rquote + $ident_re $sep ($ident_re) | [\s,] \w+ \. (\w+) [\s,] | - [\s,] $lquote (.+?) $rquote [\s,] + [\s,] ($ident_re) [\s,] /gx) { - my $part = $1 || $2 || $3; # one of them matched if we got here + my $part = $sql_maker->_unquote($1 || $2 || $3); # one of them matched if we got here unless ($seen_having{$part}++) { push @parts, $part; }