making the dequalifer aware of the table name so it will not strip out schema.table... ghpr/closed/inspiring_554f3621
Kevin L. Kane [Thu, 7 Mar 2013 21:12:09 +0000 (16:12 -0500)]
lib/DBIx/Class/ResultSet.pm
lib/DBIx/Class/SQLMaker.pm

index eec34b3..f1595ee 100644 (file)
@@ -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}) ];
     };
   }
index 1162280..44e5ecb 100644 (file)
@@ -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]
   );