Fix Verisoned.pm to not issue queries that break down with quoting
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Schema / Versioned.pm
index 052f8e7..5a861ba 100644 (file)
@@ -725,9 +725,12 @@ sub _source_exists
 {
     my ($self, $rs) = @_;
 
-    my $c = try { $rs->search({ 1, 0 })->count };
-
-    return (defined $c) ? 1 : 0;
+    return try {
+      $rs->search(\'1=0')->cursor->next;
+      1;
+    } catch {
+      0;
+    };
 }
 
 1;