Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.416
diff -u -p -r1.416 bootstrap.inc
--- includes/bootstrap.inc	22 Aug 2010 14:11:47 -0000	1.416
+++ includes/bootstrap.inc	23 Aug 2010 16:07:26 -0000
@@ -2697,6 +2697,14 @@ function _registry_check_code($type, $na
   if ($type == 'class' && class_exists($name) || $type == 'interface' && interface_exists($name)) {
     return TRUE;
   }
+  
+  // We don't have any tables in our tables. Probably the tables have been deleted but
+  // the database settings work. So let's redirect to install.php
+  if (Database::getConnection('default', 'default')->query("SHOW TABLES")->fetchField() === FALSE){
+    // We cannot use drupal_goto() as the bootstrap is not finished yet
+    header('Location: '. 'install.php', TRUE, 303);
+    exit;
+  }
 
   if (!isset($lookup_cache)) {
     $lookup_cache = array();
