From: Matt S Trout Date: Sun, 17 Nov 2013 08:18:06 +0000 (+0000) Subject: switch to delete+local from clear_* methods X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a14cff9712c23c5761aa570176b9325e611c4360;p=dbsrgits%2FDBIx-Class.git switch to delete+local from clear_* methods --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 846922e..91a5932 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -1696,16 +1696,14 @@ sub _count_subq_rs { $sql_maker->{name_sep} = ''; } - $sql_maker->clear_renderer; - $sql_maker->clear_converter; + # delete local is 5.12+ + local @{$sql_maker}{qw(renderer converter)}; + delete @{$sql_maker}{qw(renderer converter)}; my ($lquote, $rquote, $sep) = map { quotemeta $_ } ($sql_maker->_quote_chars, $sql_maker->name_sep); 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 diff --git a/lib/DBIx/Class/Storage/DBIHacks.pm b/lib/DBIx/Class/Storage/DBIHacks.pm index 3033173..7334686 100644 --- a/lib/DBIx/Class/Storage/DBIHacks.pm +++ b/lib/DBIx/Class/Storage/DBIHacks.pm @@ -413,9 +413,9 @@ sub _resolve_aliastypes_from_select_args { $sql_maker->{name_sep} = ''; } - # local is not enough - need to ensure the inner objects get rebuilt - $sql_maker->clear_renderer; - $sql_maker->clear_converter; + # delete local is 5.12+ + local @{$sql_maker}{qw(renderer converter)}; + delete @{$sql_maker}{qw(renderer converter)}; my ($lquote, $rquote, $sep) = map { quotemeta $_ } ($sql_maker->_quote_chars, $sql_maker->name_sep); @@ -453,10 +453,6 @@ sub _resolve_aliastypes_from_select_args { ], }; - # local is not enough - need to ensure the inner objects get rebuilt - $sql_maker->clear_renderer; - $sql_maker->clear_converter; - # throw away empty chunks $_ = [ map { $_ || () } @$_ ] for values %$to_scan; @@ -852,7 +848,9 @@ sub _extract_order_criteria { $order_dq = $order_dq->{from}; } - delete local @{$sql_maker}{qw(quote_char renderer converter)}; + # delete local is 5.12+ + local @{$sql_maker}{qw(quote_char renderer converter)}; + delete @{$sql_maker}{qw(quote_char renderer converter)}; return map { [ $sql_maker->_render_dq($_) ] } do { if ($ident_only) { diff --git a/t/sqlmaker/oracle.t b/t/sqlmaker/oracle.t index 560406a..1d8dfe9 100644 --- a/t/sqlmaker/oracle.t +++ b/t/sqlmaker/oracle.t @@ -119,9 +119,11 @@ sub UREF { \do { my $x } }; $sqla_oracle->{bindtype} = 'columns'; for my $q ('', '"') { - local $sqla_oracle->{quote_char} = $q; - $sqla_oracle->clear_renderer; - $sqla_oracle->clear_converter; + # delete local is 5.12+ + local @{$sqla_oracle}{qw(quote_char renderer converter)}; + delete @{$sqla_oracle}{qw(quote_char renderer converter)}; + + $sqla_oracle->{quote_char} = $q; my ($sql, @bind) = $sqla_oracle->insert( 'artist',