From: Kevin L. Kane Date: Thu, 7 Mar 2013 21:12:09 +0000 (-0500) Subject: making the dequalifer aware of the table name so it will not strip out schema.table... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fghpr%2Fclosed%2Finspiring_554f3621;p=dbsrgits%2FDBIx-Class-Historic.git making the dequalifer aware of the table name so it will not strip out schema.table if that is how the table is defined --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index eec34b3..f1595ee 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -1812,6 +1812,7 @@ sub _rs_update_delete { $cond = do { my $sqla = $rsrc->storage->sql_maker; local $sqla->{_dequalify_idents} = 1; + local $sqla->{_table_name} = $rsrc->name; \[ $sqla->_recurse_where($self->{cond}) ]; }; } diff --git a/lib/DBIx/Class/SQLMaker.pm b/lib/DBIx/Class/SQLMaker.pm index 1162280..44e5ecb 100644 --- a/lib/DBIx/Class/SQLMaker.pm +++ b/lib/DBIx/Class/SQLMaker.pm @@ -87,7 +87,8 @@ sub __max_int () { 0x7FFFFFFF }; # poor man's de-qualifier sub _quote { - $_[0]->next::method( ( $_[0]{_dequalify_idents} and ! ref $_[1] ) + $_[0]->next::method( ( $_[0]{_dequalify_idents} and (! ref $_[1]) + and $_[1] ne $_[0]{_table_name} ) ? $_[1] =~ / ([^\.]+) $ /x : $_[1] );