simplify and generalize table literal handling
Matt S Trout [Sat, 14 Apr 2012 18:03:32 +0000 (18:03 +0000)]
lib/SQL/Abstract.pm

index aca4315..d622f39 100644 (file)
@@ -772,12 +772,8 @@ sub _table_to_dq {
       };
     }
     $dq;
-  } elsif (ref($from) eq 'SCALAR') {
-    +{
-      type => DQ_LITERAL,
-      subtype => 'SQL',
-      literal => $$from
-    }
+  } elsif (ref($from) eq 'SCALAR' or (ref($from) eq 'REF')) {
+    $self->_literal_to_dq($$from);
   } else {
     $self->_ident_to_dq($from);
   }