From: Matt S Trout Date: Wed, 9 Oct 2013 15:52:39 +0000 (+0000) Subject: switch having code in _count_subq_rs to DQ SQLA, update regexp X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9cc08710b8821156d0f8f0a6a4dcdae8460bffb8;p=dbsrgits%2FDBIx-Class.git switch having code in _count_subq_rs to DQ SQLA, update regexp --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 1ed49ce..027a064 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -1729,15 +1729,22 @@ sub _count_subq_rs { $sql_maker->{name_sep} = ''; } + $sql_maker->clear_renderer; + $sql_maker->clear_converter; + my ($lquote, $rquote, $sep) = map { quotemeta $_ } ($sql_maker->_quote_chars, $sql_maker->name_sep); - my $having_sql = $sql_maker->_parse_rs_attrs ({ having => $attrs->{having} }); + my $having_sql = $sql_maker->_render_sqla(where => $attrs->{having}); + + $sql_maker->clear_renderer; + $sql_maker->clear_converter; + my %seen_having; # 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 + (?: $rquote $sep)? $lquote (.+?) $rquote | [\s,] \w+ \. (\w+) [\s,] |