Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.167
diff -u -p -r1.167 bootstrap.inc
--- includes/bootstrap.inc	25 May 2007 21:01:29 -0000	1.167
+++ includes/bootstrap.inc	26 May 2007 16:05:43 -0000
@@ -1029,7 +1029,7 @@ function language_list($field = 'languag
 
   // Init language list
   if (!isset($languages)) {
-    $result = db_query('SELECT * FROM {languages} ORDER BY weight ASC, name ASC');
+    $result = db_query('SELECT * FROM {language} ORDER BY weight ASC, name ASC');
     while ($row = db_fetch_object($result)) {
       $languages['language'][$row->language] = $row;
     }
Index: includes/database.mysql.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database.mysql.inc,v
retrieving revision 1.73
diff -u -p -r1.73 database.mysql.inc
--- includes/database.mysql.inc	25 May 2007 21:01:30 -0000	1.73
+++ includes/database.mysql.inc	26 May 2007 16:05:43 -0000
@@ -252,7 +252,7 @@ function db_error() {
 function db_next_id($name) {
   global $active_db;
   $name = db_prefix_tables($name);
-  db_query('INSERT INTO {sequences} VALUES ("%s", LAST_INSERT_ID(1)) ON DUPLICATE KEY UPDATE id = LAST_INSERT_ID(id + 1)', $name);
+  db_query('INSERT INTO {sequence} VALUES ("%s", LAST_INSERT_ID(1)) ON DUPLICATE KEY UPDATE id = LAST_INSERT_ID(id + 1)', $name);
 
   return mysql_insert_id($active_db);
 }
Index: includes/database.mysqli.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database.mysqli.inc,v
retrieving revision 1.37
diff -u -p -r1.37 database.mysqli.inc
--- includes/database.mysqli.inc	25 May 2007 21:01:30 -0000	1.37
+++ includes/database.mysqli.inc	26 May 2007 16:05:44 -0000
@@ -244,7 +244,7 @@ function db_error() {
 function db_next_id($name) {
   global $active_db;
   $name = db_prefix_tables($name);
-  db_query('INSERT INTO {sequences} VALUES ("%s", LAST_INSERT_ID(1)) ON DUPLICATE KEY UPDATE id = LAST_INSERT_ID(id + 1)', $name);
+  db_query('INSERT INTO {sequence} VALUES ("%s", LAST_INSERT_ID(1)) ON DUPLICATE KEY UPDATE id = LAST_INSERT_ID(id + 1)', $name);
 
   return mysqli_insert_id($active_db);
 }
Index: includes/locale.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/locale.inc,v
retrieving revision 1.129
diff -u -p -r1.129 locale.inc
--- includes/locale.inc	22 May 2007 07:42:36 -0000	1.129
+++ includes/locale.inc	26 May 2007 16:05:46 -0000
@@ -98,7 +98,7 @@ function locale_languages_overview_form_
       $language->enabled = 0;
     }
     $language->weight = $form_values['weight'][$langcode];
-    db_query("UPDATE {languages} SET enabled = %d, weight = %d WHERE language = '%s'", $language->enabled, $language->weight, $langcode);
+    db_query("UPDATE {language} SET enabled = %d, weight = %d WHERE language = '%s'", $language->enabled, $language->weight, $langcode);
     $languages[$langcode] = $language;
   }
   drupal_set_message(t('Configuration saved.'));
@@ -177,7 +177,7 @@ function locale_languages_custom_form() 
  *   Language code of the language to edit.
  */
 function locale_languages_edit_form($langcode) {
-  if ($language = db_fetch_object(db_query("SELECT * FROM {languages} WHERE language = '%s'", $langcode))) {
+  if ($language = db_fetch_object(db_query("SELECT * FROM {language} WHERE language = '%s'", $langcode))) {
     $form = array();
     _locale_languages_common_controls($form, $language);
     $form['submit'] = array(
@@ -269,7 +269,7 @@ function _locale_languages_common_contro
 function locale_languages_predefined_form_validate($form_values, $form, &$form_state) {
   $langcode = $form_values['langcode'];
 
-  if ($duplicate = db_num_rows(db_query("SELECT language FROM {languages} WHERE language = '%s'", $langcode)) != 0) {
+  if ($duplicate = db_num_rows(db_query("SELECT language FROM {language} WHERE language = '%s'", $langcode)) != 0) {
     form_set_error('langcode', t('The language %language (%code) already exists.', array('%language' => $form_values['name'], '%code' => $langcode)));
   }
 
@@ -320,14 +320,14 @@ function locale_languages_edit_form_vali
   if (!empty($form_values['domain']) && !empty($form_values['prefix'])) {
     form_set_error('prefix', t('Domain and path prefix values should not be set at the same time.'));
   }
-  if (!empty($form_values['domain']) && $duplicate = db_fetch_object(db_query("SELECT language FROM {languages} WHERE domain = '%s' AND language != '%s'", $form_values['domain'], $form_values['langcode']))) {
+  if (!empty($form_values['domain']) && $duplicate = db_fetch_object(db_query("SELECT language FROM {language} WHERE domain = '%s' AND language != '%s'", $form_values['domain'], $form_values['langcode']))) {
     form_set_error('domain', t('The domain (%domain) is already tied to a language (%language).', array('%domain' => $form_values['domain'], '%language' => $duplicate->language)));
   }
   $default = language_default();
   if (empty($form_values['prefix']) && $default->language != $form_values['langcode'] && empty($form_values['domain'])) {
     form_set_error('prefix', t('Only the default language can have both the domain and prefix empty.'));
   }
-  if (!empty($form_values['prefix']) && $duplicate = db_fetch_object(db_query("SELECT language FROM {languages} WHERE prefix = '%s' AND language != '%s'", $form_values['prefix'], $form_values['langcode']))) {
+  if (!empty($form_values['prefix']) && $duplicate = db_fetch_object(db_query("SELECT language FROM {language} WHERE prefix = '%s' AND language != '%s'", $form_values['prefix'], $form_values['langcode']))) {
     form_set_error('prefix', t('The prefix (%prefix) is already tied to a language (%language).', array('%prefix' => $form_values['prefix'], '%language' => $duplicate->language)));
   }
 }
@@ -336,7 +336,7 @@ function locale_languages_edit_form_vali
  * Process the language editing form submission.
  */
 function locale_languages_edit_form_submit($form_values, $form, &$form_state) {
-  db_query("UPDATE {languages} SET name = '%s', native = '%s', domain = '%s', prefix = '%s', direction = %d WHERE language = '%s'", $form_values['name'], $form_values['native'], $form_values['domain'], $form_values['prefix'], $form_values['direction'], $form_values['langcode']);
+  db_query("UPDATE {language} SET name = '%s', native = '%s', domain = '%s', prefix = '%s', direction = %d WHERE language = '%s'", $form_values['name'], $form_values['native'], $form_values['domain'], $form_values['prefix'], $form_values['direction'], $form_values['langcode']);
   $default = language_default();
   if ($default->language == $form_values['langcode']) {
     $properties = array('name', 'native', 'direction', 'enabled', 'plurals', 'formula', 'domain', 'prefix', 'weight');
@@ -392,7 +392,7 @@ function locale_languages_delete_form($l
 function locale_languages_delete_form_submit($form_values, $form, &$form_state) {
   $languages = language_list();
   if (isset($languages[$form_values['langcode']])) {
-    db_query("DELETE FROM {languages} WHERE language = '%s'", $form_values['langcode']);
+    db_query("DELETE FROM {language} WHERE language = '%s'", $form_values['langcode']);
     db_query("DELETE FROM {locales_target} WHERE language = '%s'", $form_values['langcode']);
     db_query("UPDATE {node} SET language = '' WHERE language = '%s'", $form_values['langcode']);
     $variables = array('%locale' => $languages[$form_values['langcode']]->name);
@@ -868,7 +868,7 @@ function locale_add_language($langcode, 
     $direction = isset($predefined[$langcode][2]) ? $predefined[$langcode][2] : LANGUAGE_LTR;
   }
 
-  db_query("INSERT INTO {languages} (language, name, native, direction, domain, prefix, enabled) VALUES ('%s', '%s', '%s', %d, '%s', '%s', %d)", $langcode, $name, $native, $direction, $domain, $prefix, $enabled);
+  db_query("INSERT INTO {language} (language, name, native, direction, domain, prefix, enabled) VALUES ('%s', '%s', '%s', %d, '%s', '%s', %d)", $langcode, $name, $native, $direction, $domain, $prefix, $enabled);
 
   // Add empty translations for strings (to optimize locale())
   $result = db_query("SELECT lid FROM {locales_source}");
@@ -914,7 +914,7 @@ function _locale_import_po($file, $lang,
   }
 
   // Check if we have the language already in the database
-  if (!db_fetch_object(db_query("SELECT language FROM {languages} WHERE language = '%s'", $lang))) {
+  if (!db_fetch_object(db_query("SELECT language FROM {language} WHERE language = '%s'", $lang))) {
     drupal_set_message(t('The language selected for import is not supported.'), 'error');
     return FALSE;
   }
@@ -1154,10 +1154,10 @@ function _locale_import_one_string($op, 
         // Get the plural formula
         if (isset($hdr["Plural-Forms"]) && $p = _locale_import_parse_plural_forms($hdr["Plural-Forms"], $file->filename)) {
           list($nplurals, $plural) = $p;
-          db_query("UPDATE {languages} SET plurals = %d, formula = '%s' WHERE language = '%s'", $nplurals, $plural, $lang);
+          db_query("UPDATE {language} SET plurals = %d, formula = '%s' WHERE language = '%s'", $nplurals, $plural, $lang);
         }
         else {
-          db_query("UPDATE {languages} SET plurals = %d, formula = '%s' WHERE language = '%s'", 0, '', $lang);
+          db_query("UPDATE {language} SET plurals = %d, formula = '%s' WHERE language = '%s'", 0, '', $lang);
         }
         $headerdone = TRUE;
       }
@@ -1574,7 +1574,7 @@ function _locale_export_po($language = N
   $header = '';
   // Get language specific strings, or all strings
   if (isset($language)) {
-    $meta = db_fetch_object(db_query("SELECT * FROM {languages} WHERE language = '%s'", $language));
+    $meta = db_fetch_object(db_query("SELECT * FROM {language} WHERE language = '%s'", $language));
     $result = db_query("SELECT s.lid, s.source, s.location, t.translation, t.plid, t.plural FROM {locales_source} s INNER JOIN {locales_target} t ON s.lid = t.lid WHERE t.language = '%s' AND s.textgroup = '%s' ORDER BY t.plid, t.plural", $language, $group);
   }
   else {
Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.168
diff -u -p -r1.168 menu.inc
--- includes/menu.inc	26 May 2007 10:54:12 -0000	1.168
+++ includes/menu.inc	26 May 2007 16:05:46 -0000
@@ -66,7 +66,7 @@
  * menu hierarchy.
  *
  * Everything described so far is stored in the menu_router table. The
- * menu_links table holds the visible menu links. By default these are
+ * menu_link table holds the visible menu links. By default these are
  * derived from the same hook_menu definitons, however you are free to
  * add more with menu_link_save().
  */
@@ -609,11 +609,11 @@ function menu_tree_data($menu_name = 'na
   if ($item = menu_get_item()) {
     if (!isset($tree[$menu_name])) {
       if ($item->access) {
-        $parents = db_fetch_array(db_query("SELECT p1, p2, p3, p4, p5 FROM {menu_links} WHERE menu_name = '%s' AND href = '%s'", $menu_name, $item->href));
+        $parents = db_fetch_array(db_query("SELECT p1, p2, p3, p4, p5 FROM {menu_link} WHERE menu_name = '%s' AND href = '%s'", $menu_name, $item->href));
         // We may be on a local task that's not in the links
         // TODO how do we handle the case like a local task on a specific node in the menu?
         if (empty($parents)) {
-          $parents = db_fetch_array(db_query("SELECT p1, p2, p3, p4, p5 FROM {menu_links} WHERE menu_name = '%s' AND href = '%s'", $menu_name, $item->tab_root));
+          $parents = db_fetch_array(db_query("SELECT p1, p2, p3, p4, p5 FROM {menu_link} WHERE menu_name = '%s' AND href = '%s'", $menu_name, $item->tab_root));
         }
         $parents[] = '0';
 
@@ -622,7 +622,7 @@ function menu_tree_data($menu_name = 'na
         $expanded = variable_get('menu_expanded', array());
         if (in_array($menu_name, $expanded)) {
           do {
-            $result = db_query("SELECT mlid FROM {menu_links} WHERE expanded != 0 AND AND has_children != 0 AND menu_name = '%s' AND plid IN (". $placeholders .') AND mlid NOT IN ('. $placeholders .')', array_merge(array($menu_name), $args, $args));
+            $result = db_query("SELECT mlid FROM {menu_link} WHERE expanded != 0 AND AND has_children != 0 AND menu_name = '%s' AND plid IN (". $placeholders .') AND mlid NOT IN ('. $placeholders .')', array_merge(array($menu_name), $args, $args));
             while ($item = db_fetch_array($result)) {
               $args[] = $item['mlid'];
             }
@@ -639,7 +639,7 @@ function menu_tree_data($menu_name = 'na
       // LEFT JOIN since there is no match in {menu_router} for an external link.
       // No need to order by p6 - there is a sort by weight later.
       list(, $tree[$menu_name]) = _menu_tree_data(db_query("
-        SELECT *, ml.weight + 50000 AS weight FROM {menu_links} ml LEFT JOIN {menu_router} m ON m.path = ml.router_path
+        SELECT *, ml.weight + 50000 AS weight FROM {menu_link} ml LEFT JOIN {menu_router} m ON m.path = ml.router_path
         WHERE ml.menu_name = '%s' AND ml.plid IN (". $placeholders .")
         ORDER BY p1 ASC, p2 ASC, p3 ASC, p4 ASC, p5 ASC", $args), $parents);
 
@@ -797,7 +797,7 @@ function menu_get_names($reset = FALSE) 
 
   if ($reset || empty($names)) {
     $names = array();
-    $result = db_query("SELECT DISTINCT(menu_name) FROM {menu_links} ORDER BY menu_name");
+    $result = db_query("SELECT DISTINCT(menu_name) FROM {menu_link} ORDER BY menu_name");
     while ($name = db_fetch_array($result)) {
       $names[] = $name['menu_name'];
     }
@@ -1014,7 +1014,7 @@ function menu_get_active_title() {
  *   rendering.
  */
 function menu_get_item_by_mlid($mlid) {
-  if ($item = db_fetch_object(db_query("SELECT * FROM {menu_links} ml LEFT JOIN {menu_router} m ON m.path = ml.router_path WHERE mlid = %d", $mlid))) {
+  if ($item = db_fetch_object(db_query("SELECT * FROM {menu_link} ml LEFT JOIN {menu_router} m ON m.path = ml.router_path WHERE mlid = %d", $mlid))) {
     _menu_link_translate($item);
     if ($item->access) {
       return $item;
@@ -1053,13 +1053,13 @@ function menu_cache_clear($menu_name = '
  * router items or menu links.
  */
 function menu_cache_clear_all() {
-  cache_clear_all('*', 'menu_links', TRUE);
+  cache_clear_all('*', 'menu_link', TRUE);
   cache_clear_all('*', 'menu_router', TRUE);
 }
 
 /**
  * Populate the database representation of the {menu_router} table (router items)
- * and the navigation menu in the {menu_links} table.
+ * and the navigation menu in the {menu_link} table.
  */
 function menu_rebuild() {
   menu_cache_clear_all();
@@ -1104,7 +1104,7 @@ function _menu_navigation_links_rebuild(
       'hidden' => 0,
     );
     // We add nonexisting items.
-    if ($item['_visible'] && !db_result(db_query("SELECT COUNT(*) FROM {menu_links} WHERE menu_name = '%s' AND href = '%s'", $item['menu name'], $item['href']))) {
+    if ($item['_visible'] && !db_result(db_query("SELECT COUNT(*) FROM {menu_link} WHERE menu_name = '%s' AND href = '%s'", $item['menu name'], $item['href']))) {
       $menu_links[$path] = $item;
       $sort[$path] = $item['_number_parts'];
     }
@@ -1119,7 +1119,7 @@ function _menu_navigation_links_rebuild(
   }
   $placeholders = implode(', ', array_fill(0, count($menu), "'%s'"));
   // Remove items if their router path does not exist any more.
-  db_query('DELETE FROM {menu_links} WHERE router_path NOT IN ('. $placeholders .')', array_keys($menu));
+  db_query('DELETE FROM {menu_link} WHERE router_path NOT IN ('. $placeholders .')', array_keys($menu));
 }
 
 /**
@@ -1162,14 +1162,14 @@ function menu_link_save(&$item, $_menu =
   );
   $existing_item = array();
   if (isset($item['mlid'])) {
-    $existing_item = db_fetch_array(db_query("SELECT * FROM {menu_links} WHERE mlid = %d", $item['mlid']));
+    $existing_item = db_fetch_array(db_query("SELECT * FROM {menu_link} WHERE mlid = %d", $item['mlid']));
   }
   else {
-    $existing_item = db_fetch_array(db_query("SELECT * FROM {menu_links} WHERE menu_name = '%s' AND href = '%s'", $item['menu name'], $item['href']));
+    $existing_item = db_fetch_array(db_query("SELECT * FROM {menu_link} WHERE menu_name = '%s' AND href = '%s'", $item['menu name'], $item['href']));
   }
 
   if (empty($existing_item)) {
-    $item['mlid'] = db_next_id('{menu_links}_mlid');
+    $item['mlid'] = db_next_id('{menu_link}_mlid');
   }
 
   $menu_name = $item['menu name'];
@@ -1177,13 +1177,13 @@ function menu_link_save(&$item, $_menu =
 
   // Find the parent.
   if (isset($item['plid'])) {
-    $parent = db_fetch_array(db_query("SELECT * FROM {menu_links} WHERE mlid = %d", $item['plid']));
+    $parent = db_fetch_array(db_query("SELECT * FROM {menu_link} WHERE mlid = %d", $item['plid']));
   }
   else { //
     $parent_path = $item['href'];
     do {
       $parent_path = substr($parent_path, 0, strrpos($parent_path, '/'));
-      $parent = db_fetch_array(db_query("SELECT * FROM {menu_links} WHERE menu_name = '%s' AND href = '%s'", $menu_name, $parent_path));
+      $parent = db_fetch_array(db_query("SELECT * FROM {menu_link} WHERE menu_name = '%s' AND href = '%s'", $menu_name, $parent_path));
     } while ($parent === FALSE && $parent_path);
   }
   // Menu callbacks need to be in the links table for breadcrumbs, but can't
@@ -1236,7 +1236,7 @@ function menu_link_save(&$item, $_menu =
     }
   }
   if (!empty($existing_item)) {
-    db_query("UPDATE {menu_links} SET menu_name = '%s', plid = %d, href = '%s',
+    db_query("UPDATE {menu_link} SET menu_name = '%s', plid = %d, href = '%s',
       router_path = '%s', hidden = %d, external = %d, has_children = %d,
       expanded = %d, weight = %d,  depth = %d,
       p1 = %d, p2 = %d, p3 = %d, p4 = %d, p5 = %d, p6 = %d,
@@ -1248,7 +1248,7 @@ function menu_link_save(&$item, $_menu =
       $item['module'],  $item['link_title'], serialize($item['options']), $item['mlid']);
   }
   else {
-    db_query("INSERT INTO {menu_links} (
+    db_query("INSERT INTO {menu_link} (
       menu_name, mlid, plid, href,
       router_path, hidden, external, has_children,
       expanded, weight, depth,
@@ -1267,12 +1267,12 @@ function menu_link_save(&$item, $_menu =
  }
 
   if ($item['plid'] && !$item['hidden']) {
-    db_query("UPDATE {menu_links} SET has_children = 1 WHERE mlid = %d", $item['plid']);
+    db_query("UPDATE {menu_link} SET has_children = 1 WHERE mlid = %d", $item['plid']);
   }
 
   // Keep track of which menus have expanded items
   $names = array();
-  $result = db_query("SELECT menu_name FROM {menu_links} WHERE expanded != 0 GROUP BY menu_name");
+  $result = db_query("SELECT menu_name FROM {menu_link} WHERE expanded != 0 GROUP BY menu_name");
   while ($n = db_fetch_array($result)) {
     $names[] = $n['menu_name'];
   }
Index: includes/session.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/session.inc,v
retrieving revision 1.40
diff -u -p -r1.40 session.inc
--- includes/session.inc	25 May 2007 15:04:41 -0000	1.40
+++ includes/session.inc	26 May 2007 16:05:47 -0000
@@ -29,7 +29,7 @@ function sess_read($key) {
   }
 
   // Otherwise, if the session is still active, we have a record of the client's session in the database.
-  $user = db_fetch_object(db_query("SELECT u.*, s.* FROM {users} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.sid = '%s'", $key));
+  $user = db_fetch_object(db_query("SELECT u.*, s.* FROM {user} u INNER JOIN {session} s ON u.uid = s.uid WHERE s.sid = '%s'", $key));
 
   // We found the client's session record and they are an authenticated user
   if ($user && $user->uid > 0) {
@@ -39,7 +39,7 @@ function sess_read($key) {
     // Add roles element to $user
     $user->roles = array();
     $user->roles[DRUPAL_AUTHENTICATED_RID] = 'authenticated user';
-    $result = db_query("SELECT r.rid, r.name FROM {role} r INNER JOIN {users_roles} ur ON ur.rid = r.rid WHERE ur.uid = %d", $user->uid);
+    $result = db_query("SELECT r.rid, r.name FROM {role} r INNER JOIN {user_role} ur ON ur.rid = r.rid WHERE ur.uid = %d", $user->uid);
     while ($role = db_fetch_object($result)) {
       $user->roles[$role->rid] = $role->name;
     }
@@ -61,7 +61,7 @@ function sess_write($key, $value) {
     return TRUE;
   }
 
-  $result = db_query("SELECT sid FROM {sessions} WHERE sid = '%s'", $key);
+  $result = db_query("SELECT sid FROM {session} WHERE sid = '%s'", $key);
 
   if (!db_num_rows($result)) {
     // Only save session data when when the browser sends a cookie. This keeps
@@ -69,15 +69,15 @@ function sess_write($key, $value) {
     // and gives more useful statistics. We can't eliminate anonymous session
     // table rows without breaking throttle module and "Who's Online" block.
     if ($user->uid || $value || count($_COOKIE)) {
-      db_query("INSERT INTO {sessions} (sid, uid, cache, hostname, session, timestamp) VALUES ('%s', %d, %d, '%s', '%s', %d)", $key, $user->uid, isset($user->cache) ? $user->cache : '', ip_address(), $value, time());
+      db_query("INSERT INTO {session} (sid, uid, cache, hostname, session, timestamp) VALUES ('%s', %d, %d, '%s', '%s', %d)", $key, $user->uid, isset($user->cache) ? $user->cache : '', ip_address(), $value, time());
     }
   }
   else {
-    db_query("UPDATE {sessions} SET uid = %d, cache = %d, hostname = '%s', session = '%s', timestamp = %d WHERE sid = '%s'", $user->uid, isset($user->cache) ? $user->cache : '', ip_address(), $value, time(), $key);
+    db_query("UPDATE {session} SET uid = %d, cache = %d, hostname = '%s', session = '%s', timestamp = %d WHERE sid = '%s'", $user->uid, isset($user->cache) ? $user->cache : '', ip_address(), $value, time(), $key);
 
     // TODO: this can be an expensive query. Perhaps only execute it every x minutes. Requires investigation into cache expiration.
     if ($user->uid) {
-      db_query("UPDATE {users} SET access = %d WHERE uid = %d", time(), $user->uid);
+      db_query("UPDATE {user} SET access = %d WHERE uid = %d", time(), $user->uid);
     }
   }
 
@@ -101,7 +101,7 @@ function sess_regenerate() {
 
   session_regenerate_id();
 
-  db_query("UPDATE {sessions} SET sid = '%s' WHERE sid = '%s'", session_id(), $old_session_id);
+  db_query("UPDATE {session} SET sid = '%s' WHERE sid = '%s'", session_id(), $old_session_id);
 }
 
 /**
@@ -119,7 +119,7 @@ function sess_regenerate() {
  */
 function sess_count($timestamp = 0, $anonymous = true) {
   $query = $anonymous ? ' AND uid = 0' : ' AND uid > 0';
-  return db_result(db_query('SELECT COUNT(sid) AS count FROM {sessions} WHERE timestamp >= %d'. $query, $timestamp));
+  return db_result(db_query('SELECT COUNT(sid) AS count FROM {session} WHERE timestamp >= %d'. $query, $timestamp));
 }
 
 /**
@@ -129,7 +129,7 @@ function sess_count($timestamp = 0, $ano
  *   the session id
  */
 function sess_destroy_sid($sid) {
-  db_query("DELETE FROM {sessions} WHERE sid = '%s'", $sid);
+  db_query("DELETE FROM {session} WHERE sid = '%s'", $sid);
 }
 
 /**
@@ -139,7 +139,7 @@ function sess_destroy_sid($sid) {
  *   the user id
  */
 function sess_destroy_uid($uid) {
-  db_query('DELETE FROM {sessions} WHERE uid = %d', $uid);
+  db_query('DELETE FROM {session} WHERE uid = %d', $uid);
 }
 
 function sess_gc($lifetime) {
@@ -148,7 +148,7 @@ function sess_gc($lifetime) {
   // for three weeks before deleting them, you need to set gc_maxlifetime
   // to '1814400'. At that value, only after a user doesn't log in after
   // three weeks (1814400 seconds) will his/her session be removed.
-  db_query("DELETE FROM {sessions} WHERE timestamp < %d", time() - $lifetime);
+  db_query("DELETE FROM {session} WHERE timestamp < %d", time() - $lifetime);
 
   return TRUE;
 }
Index: modules/block/block.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.module,v
retrieving revision 1.261
diff -u -p -r1.261 block.module
--- modules/block/block.module	20 May 2007 16:40:20 -0000	1.261
+++ modules/block/block.module	26 May 2007 16:05:47 -0000
@@ -120,7 +120,7 @@ function block_block($op = 'list', $delt
     case 'list':
       $blocks = array();
 
-      $result = db_query('SELECT bid, info FROM {boxes} ORDER BY info');
+      $result = db_query('SELECT bid, info FROM {box} ORDER BY info');
       while ($block = db_fetch_object($result)) {
         $blocks[$block->bid]['info'] = $block->info;
       }
@@ -141,7 +141,7 @@ function block_block($op = 'list', $delt
       break;
 
     case 'view':
-      $block = db_fetch_object(db_query('SELECT * FROM {boxes} WHERE bid = %d', $delta));
+      $block = db_fetch_object(db_query('SELECT * FROM {box} WHERE bid = %d', $delta));
       $data['content'] = check_markup($block->body, $block->format, FALSE);
       return $data;
   }
@@ -158,7 +158,7 @@ function _block_rehash() {
 
   init_theme();
 
-  $result = db_query("SELECT * FROM {blocks} WHERE theme = '%s'", $theme_key);
+  $result = db_query("SELECT * FROM {block} WHERE theme = '%s'", $theme_key);
   while ($old_block = db_fetch_object($result)) {
     $old_blocks[$old_block->module][$old_block->delta] = $old_block;
   }
@@ -197,9 +197,9 @@ function _block_rehash() {
     }
   }
 
-  db_lock_table('blocks');
+  db_lock_table('block');
   // Remove all blocks from table.
-  db_query("DELETE FROM {blocks} WHERE theme = '%s'", $theme_key);
+  db_query("DELETE FROM {block} WHERE theme = '%s'", $theme_key);
 
   // Reinsert new set of blocks into table.
   foreach ($blocks as $block) {
@@ -207,7 +207,7 @@ function _block_rehash() {
       'visibility' => NULL,
       'throttle' => NULL,
     );
-    db_query("INSERT INTO {blocks} (module, delta, theme, status, weight, region, visibility, pages, custom, throttle, title) VALUES ('%s', '%s', '%s', %d, %d, '%s', %d, '%s', %d, %d, '%s')", $block['module'], $block['delta'], $theme_key, $block['status'], $block['weight'], $block['region'], $block['visibility'], $block['pages'], $block['custom'], $block['throttle'], $block['title']);
+    db_query("INSERT INTO {block} (module, delta, theme, status, weight, region, visibility, pages, custom, throttle, title) VALUES ('%s', '%s', '%s', %d, %d, '%s', %d, '%s', %d, %d, '%s')", $block['module'], $block['delta'], $theme_key, $block['status'], $block['weight'], $block['region'], $block['visibility'], $block['pages'], $block['custom'], $block['throttle'], $block['title']);
   }
   db_unlock_tables();
 
@@ -296,7 +296,7 @@ function block_admin_display_submit($for
   foreach ($form_values as $block) {
     $block['status'] = $block['region'] != BLOCK_REGION_NONE;
     $block['region'] = $block['status'] ? $block['region'] : '';
-    db_query("UPDATE {blocks} SET status = %d, weight = %d, region = '%s', throttle = %d WHERE module = '%s' AND delta = '%s' AND theme = '%s'", $block['status'], $block['weight'], $block['region'], isset($block['throttle']) ? $block['throttle'] : 0, $block['module'], $block['delta'], $block['theme']);
+    db_query("UPDATE {block} SET status = %d, weight = %d, region = '%s', throttle = %d WHERE module = '%s' AND delta = '%s' AND theme = '%s'", $block['status'], $block['weight'], $block['region'], isset($block['throttle']) ? $block['throttle'] : 0, $block['module'], $block['delta'], $block['theme']);
   }
   drupal_set_message(t('The block settings have been updated.'));
   cache_clear_all();
@@ -373,7 +373,7 @@ function theme_block_admin_display($form
 }
 
 function block_box_get($bid) {
-  return db_fetch_array(db_query("SELECT bx.*, bl.title FROM {boxes} bx INNER JOIN {blocks} bl ON bx.bid = bl.delta WHERE bl.module = 'block' AND bx.bid = %d", $bid));
+  return db_fetch_array(db_query("SELECT bx.*, bl.title FROM {box} bx INNER JOIN {block} bl ON bx.bid = bl.delta WHERE bl.module = 'block' AND bx.bid = %d", $bid));
 }
 
 /**
@@ -384,7 +384,7 @@ function block_admin_configure($module =
   $form['module'] = array('#type' => 'value', '#value' => $module);
   $form['delta'] = array('#type' => 'value', '#value' => $delta);
 
-  $edit = db_fetch_array(db_query("SELECT pages, visibility, custom, title FROM {blocks} WHERE module = '%s' AND delta = '%s'", $module, $delta));
+  $edit = db_fetch_array(db_query("SELECT pages, visibility, custom, title FROM {block} WHERE module = '%s' AND delta = '%s'", $module, $delta));
 
   $form['block_settings'] = array(
     '#type' => 'fieldset',
@@ -434,7 +434,7 @@ function block_admin_configure($module =
 
   // Role-based visibility settings
   $default_role_options = array();
-  $result = db_query("SELECT rid FROM {blocks_roles} WHERE module = '%s' AND delta = '%s'", $module, $delta);
+  $result = db_query("SELECT rid FROM {block_role} WHERE module = '%s' AND delta = '%s'", $module, $delta);
   while ($role = db_fetch_object($result)) {
     $default_role_options[] = $role->rid;
   }
@@ -500,7 +500,7 @@ function block_admin_configure($module =
 
 function block_admin_configure_validate($form_values, $form, &$form_state) {
   if ($form_values['module'] == 'block') {
-    if (empty($form_values['info']) || db_num_rows(db_query("SELECT bid FROM {boxes} WHERE bid != %d AND info = '%s'", $form_values['delta'], $form_values['info']))) {
+    if (empty($form_values['info']) || db_num_rows(db_query("SELECT bid FROM {box} WHERE bid != %d AND info = '%s'", $form_values['delta'], $form_values['info']))) {
       form_set_error('info', t('Please ensure that each block description is unique.'));
     }
   }
@@ -508,10 +508,10 @@ function block_admin_configure_validate(
 
 function block_admin_configure_submit($form_values, $form, &$form_state) {
   if (!form_get_errors()) {
-    db_query("UPDATE {blocks} SET visibility = %d, pages = '%s', custom = %d, title = '%s' WHERE module = '%s' AND delta = '%s'", $form_values['visibility'], trim($form_values['pages']), $form_values['custom'], $form_values['title'], $form_values['module'], $form_values['delta']);
-    db_query("DELETE FROM {blocks_roles} WHERE module = '%s' AND delta = '%s'", $form_values['module'], $form_values['delta']);
+    db_query("UPDATE {block} SET visibility = %d, pages = '%s', custom = %d, title = '%s' WHERE module = '%s' AND delta = '%s'", $form_values['visibility'], trim($form_values['pages']), $form_values['custom'], $form_values['title'], $form_values['module'], $form_values['delta']);
+    db_query("DELETE FROM {block_role} WHERE module = '%s' AND delta = '%s'", $form_values['module'], $form_values['delta']);
     foreach (array_filter($form_values['roles']) as $rid) {
-      db_query("INSERT INTO {blocks_roles} (rid, module, delta) VALUES (%d, '%s', '%s')", $rid, $form_values['module'], $form_values['delta']);
+      db_query("INSERT INTO {block_role} (rid, module, delta) VALUES (%d, '%s', '%s')", $rid, $form_values['module'], $form_values['delta']);
     }
     module_invoke($form_values['module'], 'block', 'save', $form_values['delta'], $form_values);
     drupal_set_message(t('The block configuration has been saved.'));
@@ -529,7 +529,7 @@ function block_add_block_form() {
 }
 
 function block_add_block_form_validate($form_values, $form, &$form_state) {
-  if (empty($form_values['info']) || db_num_rows(db_query("SELECT info FROM {boxes} WHERE info = '%s'", $form_values['info']))) {
+  if (empty($form_values['info']) || db_num_rows(db_query("SELECT info FROM {box} WHERE info = '%s'", $form_values['info']))) {
     form_set_error('info', t('Please ensure that each block description is unique.'));
   }
 }
@@ -538,19 +538,19 @@ function block_add_block_form_validate($
  * Save the new custom block.
  */
 function block_add_block_form_submit($form_values, $form, &$form_state) {
-  $delta = db_next_id('{boxes}_bid');
+  $delta = db_next_id('{box}_bid');
 
   foreach (list_themes() as $key => $theme) {
     if ($theme->status) {
-      db_query("INSERT INTO {blocks} (visibility, pages, custom, title, module, theme, status, weight, delta) VALUES(%d, '%s', %d, '%s', '%s', '%s', %d, %d, %d)", $form_values['visibility'], trim($form_values['pages']), $form_values['custom'], $form_values['title'], $form_values['module'], $theme->name, 0, 0, $delta);
+      db_query("INSERT INTO {block} (visibility, pages, custom, title, module, theme, status, weight, delta) VALUES(%d, '%s', %d, '%s', '%s', '%s', %d, %d, %d)", $form_values['visibility'], trim($form_values['pages']), $form_values['custom'], $form_values['title'], $form_values['module'], $theme->name, 0, 0, $delta);
     }
   }
 
   foreach (array_filter($form_values['roles']) as $rid) {
-    db_query("INSERT INTO {blocks_roles} (rid, module, delta) VALUES (%d, '%s', '%s')", $rid, $form_values['module'], $delta);
+    db_query("INSERT INTO {block_role} (rid, module, delta) VALUES (%d, '%s', '%s')", $rid, $form_values['module'], $delta);
   }
 
-  db_query("INSERT INTO {boxes} (bid, body, info, format) VALUES  (%d, '%s', '%s', %d)", $delta, $form_values['body'], $form_values['info'], $form_values['format']);
+  db_query("INSERT INTO {box} (bid, body, info, format) VALUES  (%d, '%s', '%s', %d)", $delta, $form_values['body'], $form_values['info'], $form_values['format']);
 
   drupal_set_message(t('The block has been created.'));
   cache_clear_all();
@@ -574,8 +574,8 @@ function block_box_delete($bid = 0) {
  * Deletion of custom blocks.
  */
 function block_box_delete_submit($form_values, $form, &$form_state) {
-  db_query('DELETE FROM {boxes} WHERE bid = %d', $form_values['bid']);
-  db_query("DELETE FROM {blocks} WHERE module = 'block' AND delta = %d", $form_values['bid']);
+  db_query('DELETE FROM {box} WHERE bid = %d', $form_values['bid']);
+  db_query("DELETE FROM {block} WHERE module = 'block' AND delta = %d", $form_values['bid']);
   drupal_set_message(t('The block %name has been removed.', array('%name' => $form_values['info'])));
   cache_clear_all();
   $form_state['redirect'] = 'admin/build/block';
@@ -621,7 +621,7 @@ function block_box_save($edit, $delta) {
     $edit['format'] = FILTER_FORMAT_DEFAULT;
   }
 
-  db_query("UPDATE {boxes} SET body = '%s', info = '%s', format = %d WHERE bid = %d", $edit['body'], $edit['info'], $edit['format'], $delta);
+  db_query("UPDATE {box} SET body = '%s', info = '%s', format = %d WHERE bid = %d", $edit['body'], $edit['info'], $edit['format'], $delta);
 
   return TRUE;
 }
@@ -637,7 +637,7 @@ function block_user($type, $edit, &$user
   switch ($type) {
     case 'form':
       if ($category == 'account') {
-        $result = db_query("SELECT DISTINCT b.* FROM {blocks} b LEFT JOIN {blocks_roles} r ON b.module = r.module AND b.delta = r.delta WHERE b.status = 1 AND b.custom != 0 AND (r.rid IN (%s) OR r.rid IS NULL) ORDER BY b.weight, b.module", implode(',', array_keys($user->roles)));
+        $result = db_query("SELECT DISTINCT b.* FROM {block} b LEFT JOIN {block_role} r ON b.module = r.module AND b.delta = r.delta WHERE b.status = 1 AND b.custom != 0 AND (r.rid IN (%s) OR r.rid IS NULL) ORDER BY b.weight, b.module", implode(',', array_keys($user->roles)));
         $form['block'] = array('#type' => 'fieldset', '#title' => t('Block configuration'), '#weight' => 3, '#collapsible' => TRUE, '#tree' => TRUE);
         while ($block = db_fetch_object($result)) {
           $data = module_invoke($block->module, 'block', 'list');
@@ -684,7 +684,7 @@ function block_list($region) {
   static $blocks = array();
 
   if (!count($blocks)) {
-    $result = db_query("SELECT DISTINCT b.* FROM {blocks} b LEFT JOIN {blocks_roles} r ON b.module = r.module AND b.delta = r.delta WHERE b.theme = '%s' AND b.status = 1 AND (r.rid IN (%s) OR r.rid IS NULL) ORDER BY b.region, b.weight, b.module", $theme_key, implode(',', array_keys($user->roles)));
+    $result = db_query("SELECT DISTINCT b.* FROM {block} b LEFT JOIN {block_role} r ON b.module = r.module AND b.delta = r.delta WHERE b.theme = '%s' AND b.status = 1 AND (r.rid IN (%s) OR r.rid IS NULL) ORDER BY b.region, b.weight, b.module", $theme_key, implode(',', array_keys($user->roles)));
     while ($block = db_fetch_object($result)) {
       if (!isset($blocks[$block->region])) {
         $blocks[$block->region] = array();
Index: modules/block/block.schema
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.schema,v
retrieving revision 1.1
diff -u -p -r1.1 block.schema
--- modules/block/block.schema	25 May 2007 12:46:43 -0000	1.1
+++ modules/block/block.schema	26 May 2007 16:05:47 -0000
@@ -2,7 +2,7 @@
 // $Id: block.schema,v 1.1 2007/05/25 12:46:43 dries Exp $
 
 function block_schema() {
-  $schema['blocks'] = array(
+  $schema['block'] = array(
     'fields' => array(
       'bid'        => array('type' => 'serial', 'not null' => TRUE),
       'module'     => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''),
@@ -20,7 +20,7 @@ function block_schema() {
     'primary key' => array('bid'),
   );
 
-  $schema['blocks_roles'] = array(
+  $schema['block_role'] = array(
     'fields' => array(
       'module' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE),
       'delta'  => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE),
@@ -33,7 +33,7 @@ function block_schema() {
     ),
   );
 
-  $schema['boxes'] = array(
+  $schema['box'] = array(
     'fields' => array(
       'bid'    => array('type' => 'serial', 'not null' => TRUE),
       'body'   => array('type' => 'text', 'not null' => FALSE, 'size' => 'big'),
Index: modules/blogapi/blogapi.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/blogapi/blogapi.module,v
retrieving revision 1.106
diff -u -p -r1.106 blogapi.module
--- modules/blogapi/blogapi.module	30 Apr 2007 17:03:23 -0000	1.106
+++ modules/blogapi/blogapi.module	26 May 2007 16:05:48 -0000
@@ -322,10 +322,10 @@ function blogapi_blogger_get_recent_post
 
   $type = _blogapi_blogid($blogid);
   if ($bodies) {
-    $result = db_query_range("SELECT n.nid, n.title, r.body, r.format, n.comment, n.created, u.name FROM {node} n, {node_revisions} r, {users} u WHERE n.uid = u.uid AND n.vid = r.vid AND n.type = '%s' AND n.uid = %d ORDER BY n.created DESC",  $type, $user->uid, 0, $number_of_posts);
+    $result = db_query_range("SELECT n.nid, n.title, r.body, r.format, n.comment, n.created, u.name FROM {node} n, {node_revision} r, {user} u WHERE n.uid = u.uid AND n.vid = r.vid AND n.type = '%s' AND n.uid = %d ORDER BY n.created DESC",  $type, $user->uid, 0, $number_of_posts);
   }
   else {
-    $result = db_query_range("SELECT n.nid, n.title, n.created, u.name FROM {node} n, {users} u WHERE n.uid = u.uid AND n.type = '%s' AND n.uid = %d ORDER BY n.created DESC", $type, $user->uid, 0, $number_of_posts);
+    $result = db_query_range("SELECT n.nid, n.title, n.created, u.name FROM {node} n, {user} u WHERE n.uid = u.uid AND n.type = '%s' AND n.uid = %d ORDER BY n.created DESC", $type, $user->uid, 0, $number_of_posts);
   }
   $blogs = array();
   while ($blog = db_fetch_object($result)) {
Index: modules/book/book.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.module,v
retrieving revision 1.420
diff -u -p -r1.420 book.module
--- modules/book/book.module	14 May 2007 13:43:34 -0000	1.420
+++ modules/book/book.module	26 May 2007 16:05:49 -0000
@@ -305,12 +305,12 @@ function book_outline_submit($form_value
   switch ($op) {
     case t('Add to book outline'):
       db_query('INSERT INTO {book} (nid, vid, parent, weight) VALUES (%d, %d, %d, %d)', $node->nid, $node->vid, $form_values['parent'], $form_values['weight']);
-      db_query("UPDATE {node_revisions} SET log = '%s' WHERE vid = %d", $form_values['log'], $node->vid);
+      db_query("UPDATE {node_revision} SET log = '%s' WHERE vid = %d", $form_values['log'], $node->vid);
       drupal_set_message(t('The post has been added to the book.'));
       break;
     case t('Update book outline'):
       db_query('UPDATE {book} SET parent = %d, weight = %d WHERE vid = %d', $form_values['parent'], $form_values['weight'], $node->vid);
-      db_query("UPDATE {node_revisions} SET log = '%s' WHERE vid = %d", $form_values['log'], $node->vid);
+      db_query("UPDATE {node_revision} SET log = '%s' WHERE vid = %d", $form_values['log'], $node->vid);
       drupal_set_message(t('The book outline has been updated.'));
       break;
     case t('Remove from book outline'):
Index: modules/comment/comment.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.install,v
retrieving revision 1.2
diff -u -p -r1.2 comment.install
--- modules/comment/comment.install	13 Dec 2006 22:44:54 -0000	1.2
+++ modules/comment/comment.install	26 May 2007 16:05:49 -0000
@@ -6,6 +6,6 @@
  */
 function comment_enable() {
   // Insert records into the node_comment_statistics for nodes that are missing.
-  db_query_temporary("SELECT n.nid, n.created, n.uid FROM {node} n LEFT JOIN {node_comment_statistics} c ON n.nid = c.nid WHERE c.comment_count IS NULL", 'missing_nids');
-  db_query("INSERT INTO {node_comment_statistics} (nid, last_comment_timestamp, last_comment_name, last_comment_uid, comment_count) SELECT n.nid, n.created, NULL, n.uid, 0 FROM missing_nids n");
+  db_query_temporary("SELECT n.nid, n.created, n.uid FROM {node} n LEFT JOIN {node_comment_statistic} c ON n.nid = c.nid WHERE c.comment_count IS NULL", 'missing_nids');
+  db_query("INSERT INTO {node_comment_statistic} (nid, last_comment_timestamp, last_comment_name, last_comment_uid, comment_count) SELECT n.nid, n.created, NULL, n.uid, 0 FROM missing_nids n");
 }
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.545
diff -u -p -r1.545 comment.module
--- modules/comment/comment.module	25 May 2007 15:04:41 -0000	1.545
+++ modules/comment/comment.module	26 May 2007 16:05:51 -0000
@@ -290,7 +290,7 @@ function comment_block($op = 'list', $de
 /**
  * Find a number of recent comments. This is done in two steps.
  *   1. Find the n (specified by $number) nodes that have the most recent
- *      comments.  This is done by querying node_comment_statistics which has
+ *      comments.  This is done by querying node_comment_statistic which has
  *      an index on last_comment_timestamp, and is thus a fast query.
  *   2. Loading the information from the comments table based on the nids found
  *      in step 1.
@@ -304,7 +304,7 @@ function comment_get_recent($number = 10
   // Select the $number nodes (visible to the current user) with the most
   // recent comments. This is efficient due to the index on
   // last_comment_timestamp.
-  $result = db_query_range(db_rewrite_sql("SELECT nc.nid FROM {node_comment_statistics} nc WHERE nc.comment_count > 0 ORDER BY nc.last_comment_timestamp DESC", 'nc'), 0, $number);
+  $result = db_query_range(db_rewrite_sql("SELECT nc.nid FROM {node_comment_statistic} nc WHERE nc.comment_count > 0 ORDER BY nc.last_comment_timestamp DESC", 'nc'), 0, $number);
 
   $nids = array();
   while ($row = db_fetch_object($result)) {
@@ -315,7 +315,7 @@ function comment_get_recent($number = 10
   if (!empty($nids)) {
     // From among the comments on the nodes selected in the first query,
     // find the $number most recent comments.
-    $result = db_query_range('SELECT c.nid, c.subject, c.cid, c.timestamp FROM {comments} c INNER JOIN {node} n ON n.nid = c.nid WHERE c.nid IN ('. implode(',', $nids) .') AND n.status = 1 AND c.status = %d ORDER BY c.timestamp DESC', COMMENT_PUBLISHED, 0, $number);
+    $result = db_query_range('SELECT c.nid, c.subject, c.cid, c.timestamp FROM {comment} c INNER JOIN {node} n ON n.nid = c.nid WHERE c.nid IN ('. implode(',', $nids) .') AND n.status = 1 AND c.status = %d ORDER BY c.timestamp DESC', COMMENT_PUBLISHED, 0, $number);
     while ($comment = db_fetch_object($result)) {
       $comments[] = $comment;
     }
@@ -460,7 +460,7 @@ function comment_form_alter(&$form, $for
 function comment_nodeapi(&$node, $op, $arg = 0) {
   switch ($op) {
     case 'load':
-      return db_fetch_array(db_query("SELECT last_comment_timestamp, last_comment_name, comment_count FROM {node_comment_statistics} WHERE nid = %d", $node->nid));
+      return db_fetch_array(db_query("SELECT last_comment_timestamp, last_comment_name, comment_count FROM {node_comment_statistic} WHERE nid = %d", $node->nid));
       break;
 
     case 'prepare':
@@ -470,24 +470,24 @@ function comment_nodeapi(&$node, $op, $a
       break;
 
     case 'insert':
-      db_query('INSERT INTO {node_comment_statistics} (nid, last_comment_timestamp, last_comment_name, last_comment_uid, comment_count) VALUES (%d, %d, NULL, %d, 0)', $node->nid, $node->created, $node->uid);
+      db_query('INSERT INTO {node_comment_statistic} (nid, last_comment_timestamp, last_comment_name, last_comment_uid, comment_count) VALUES (%d, %d, NULL, %d, 0)', $node->nid, $node->created, $node->uid);
       break;
 
     case 'delete':
-      db_query('DELETE FROM {comments} WHERE nid = %d', $node->nid);
-      db_query('DELETE FROM {node_comment_statistics} WHERE nid = %d', $node->nid);
+      db_query('DELETE FROM {comment} WHERE nid = %d', $node->nid);
+      db_query('DELETE FROM {node_comment_statistic} WHERE nid = %d', $node->nid);
       break;
 
     case 'update index':
       $text = '';
-      $comments = db_query('SELECT subject, comment, format FROM {comments} WHERE nid = %d AND status = %d', $node->nid, COMMENT_PUBLISHED);
+      $comments = db_query('SELECT subject, comment, format FROM {comment} WHERE nid = %d AND status = %d', $node->nid, COMMENT_PUBLISHED);
       while ($comment = db_fetch_object($comments)) {
         $text .= '<h2>'. check_plain($comment->subject) .'</h2>'. check_markup($comment->comment, $comment->format, FALSE);
       }
       return $text;
 
     case 'search result':
-      $comments = db_result(db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = %d', $node->nid));
+      $comments = db_result(db_query('SELECT comment_count FROM {node_comment_statistic} WHERE nid = %d', $node->nid));
       return format_plural($comments, '1 comment', '@count comments');
 
     case 'rss item':
@@ -505,8 +505,8 @@ function comment_nodeapi(&$node, $op, $a
  */
 function comment_user($type, $edit, &$user, $category = NULL) {
   if ($type == 'delete') {
-    db_query('UPDATE {comments} SET uid = 0 WHERE uid = %d', $user->uid);
-    db_query('UPDATE {node_comment_statistics} SET last_comment_uid = 0 WHERE last_comment_uid = %d', $user->uid);
+    db_query('UPDATE {comment} SET uid = 0 WHERE uid = %d', $user->uid);
+    db_query('UPDATE {node_comment_statistic} SET last_comment_uid = 0 WHERE last_comment_uid = %d', $user->uid);
   }
 }
 
@@ -624,7 +624,7 @@ function comment_node_url() {
 function comment_edit($cid) {
   global $user;
 
-  $comment = db_fetch_object(db_query('SELECT c.*, u.uid, u.name AS registered_name, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d', $cid));
+  $comment = db_fetch_object(db_query('SELECT c.*, u.uid, u.name AS registered_name, u.data FROM {comment} c INNER JOIN {user} u ON c.uid = u.uid WHERE c.cid = %d', $cid));
   $comment = drupal_unpack($comment);
   $comment->name = $comment->uid ? $comment->registered_name : $comment->name;
   if (comment_access('edit', $comment)) {
@@ -678,7 +678,7 @@ function comment_reply($node, $pid = NUL
       // $pid indicates that this is a reply to a comment.
       if ($pid) {
         // load the comment whose cid = $pid
-        if ($comment = db_fetch_object(db_query('SELECT c.*, u.uid, u.name AS registered_name, u.signature, u.picture, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = %d', $pid, COMMENT_PUBLISHED))) {
+        if ($comment = db_fetch_object(db_query('SELECT c.*, u.uid, u.name AS registered_name, u.signature, u.picture, u.data FROM {comment} c INNER JOIN {user} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = %d', $pid, COMMENT_PUBLISHED))) {
           // If that comment exists, make sure that the current comment and the parent comment both
           // belong to the same parent node.
           if ($comment->nid != $node->nid) {
@@ -739,7 +739,7 @@ function comment_save($edit) {
     if (!form_get_errors()) {
       if ($edit['cid']) {
         // Update the comment in the database.
-        db_query("UPDATE {comments} SET status = %d, timestamp = %d, subject = '%s', comment = '%s', format = %d, uid = %d, name = '%s', mail = '%s', homepage = '%s' WHERE cid = %d", $edit['status'], $edit['timestamp'], $edit['subject'], $edit['comment'], $edit['format'], $edit['uid'], $edit['name'], $edit['mail'], $edit['homepage'], $edit['cid']);
+        db_query("UPDATE {comment} SET status = %d, timestamp = %d, subject = '%s', comment = '%s', format = %d, uid = %d, name = '%s', mail = '%s', homepage = '%s' WHERE cid = %d", $edit['status'], $edit['timestamp'], $edit['subject'], $edit['comment'], $edit['format'], $edit['uid'], $edit['name'], $edit['mail'], $edit['homepage'], $edit['cid']);
 
         _comment_update_node_statistics($edit['nid']);
 
@@ -752,7 +752,7 @@ function comment_save($edit) {
       else {
         // Check for duplicate comments. Note that we have to use the
         // validated/filtered data to perform such check.
-        $duplicate = db_result(db_query("SELECT COUNT(cid) FROM {comments} WHERE pid = %d AND nid = %d AND subject = '%s' AND comment = '%s'", $edit['pid'], $edit['nid'], $edit['subject'], $edit['comment']), 0);
+        $duplicate = db_result(db_query("SELECT COUNT(cid) FROM {comment} WHERE pid = %d AND nid = %d AND subject = '%s' AND comment = '%s'", $edit['pid'], $edit['nid'], $edit['subject'], $edit['comment']), 0);
         if ($duplicate != 0) {
           watchdog('content', 'Comment: duplicate %subject.', array('%subject' => $edit['subject']), WATCHDOG_WARNING);
         }
@@ -773,7 +773,7 @@ function comment_save($edit) {
         if ($edit['pid'] == 0) {
           // This is a comment with no parent comment (depth 0): we start
           // by retrieving the maximum thread level.
-          $max = db_result(db_query('SELECT MAX(thread) FROM {comments} WHERE nid = %d', $edit['nid']));
+          $max = db_result(db_query('SELECT MAX(thread) FROM {comment} WHERE nid = %d', $edit['nid']));
 
           // Strip the "/" from the end of the thread.
           $max = rtrim($max, '/');
@@ -792,7 +792,7 @@ function comment_save($edit) {
           $parent->thread = (string) rtrim((string) $parent->thread, '/');
 
           // Get the max value in _this_ thread.
-          $max = db_result(db_query("SELECT MAX(thread) FROM {comments} WHERE thread LIKE '%s.%%' AND nid = %d", $parent->thread, $edit['nid']));
+          $max = db_result(db_query("SELECT MAX(thread) FROM {comment} WHERE thread LIKE '%s.%%' AND nid = %d", $parent->thread, $edit['nid']));
 
           if ($max == '') {
             // First child of this parent.
@@ -812,7 +812,7 @@ function comment_save($edit) {
           }
         }
 
-        $edit['cid'] = db_next_id('{comments}_cid');
+        $edit['cid'] = db_next_id('{comment}_cid');
         $edit['timestamp'] = time();
 
         if ($edit['uid'] === $user->uid) { // '===' because we want to modify anonymous users too
@@ -820,7 +820,8 @@ function comment_save($edit) {
         }
 
         $edit += array('mail' => '', 'homepage' => '');
-        db_query("INSERT INTO {comments} (cid, nid, pid, uid, subject, comment, format, hostname, timestamp, status, score, users, thread, name, mail, homepage) VALUES (%d, %d, %d, %d, '%s', '%s', %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s')", $edit['cid'], $edit['nid'], $edit['pid'], $edit['uid'], $edit['subject'], $edit['comment'], $edit['format'], ip_address(), $edit['timestamp'], $status, $score, $users, $thread, $edit['name'], $edit['mail'], $edit['homepage']);
+
+        db_query("INSERT INTO {comment} (cid, nid, pid, uid, subject, comment, format, hostname, timestamp, status, score, users, thread, name, mail, homepage) VALUES (%d, %d, %d, %d, '%s', '%s', %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s')", $edit['cid'], $edit['nid'], $edit['pid'], $edit['uid'], $edit['subject'], $edit['comment'], $edit['format'], ip_address(), $edit['timestamp'], $status, $score, $users, $thread, $edit['name'], $edit['mail'], $edit['homepage']);
 
         _comment_update_node_statistics($edit['nid']);
 
@@ -981,7 +982,7 @@ function comment_render($node, $cid = 0)
 
     if ($cid) {
       // Single comment view.
-      $query = 'SELECT c.cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.signature, u.picture, u.data, c.score, c.users, c.status FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d';
+      $query = 'SELECT c.cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.signature, u.picture, u.data, c.score, c.users, c.status FROM {comment} c INNER JOIN {user} u ON c.uid = u.uid WHERE c.cid = %d';
       $query_args = array($cid);
       if (!user_access('administer comments')) {
         $query .= ' AND c.status = %d';
@@ -1000,8 +1001,8 @@ function comment_render($node, $cid = 0)
     }
     else {
       // Multiple comment view
-      $query_count = 'SELECT COUNT(*) FROM {comments} WHERE nid = %d';
-      $query = 'SELECT c.cid as cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.signature, u.picture, u.data, c.score, c.users, c.thread, c.status FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.nid = %d';
+      $query_count = 'SELECT COUNT(*) FROM {comment} WHERE nid = %d';
+      $query = 'SELECT c.cid as cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.signature, u.picture, u.data, c.score, c.users, c.thread, c.status FROM {comment} c INNER JOIN {user} u ON c.uid = u.uid WHERE c.nid = %d';
 
       $query_args = array($nid);
       if (!user_access('administer comments')) {
@@ -1101,7 +1102,7 @@ function comment_render($node, $cid = 0)
  * Menu callback; delete a comment.
  */
 function comment_delete($cid = NULL) {
-  $comment = db_fetch_object(db_query('SELECT c.*, u.name AS registered_name, u.uid FROM {comments} c INNER JOIN {users} u ON u.uid = c.uid WHERE c.cid = %d', $cid));
+  $comment = db_fetch_object(db_query('SELECT c.*, u.name AS registered_name, u.uid FROM {comment} c INNER JOIN {user} u ON u.uid = c.uid WHERE c.cid = %d', $cid));
   $comment->name = $comment->uid ? $comment->registered_name : $comment->name;
 
   $output = '';
@@ -1153,20 +1154,20 @@ function comment_confirm_delete_submit($
 function comment_operations($action = NULL) {
   if ($action == 'publish') {
     $operations = array(
-      'publish' => array(t('Publish the selected comments'), 'UPDATE {comments} SET status = '. COMMENT_PUBLISHED .' WHERE cid = %d'),
+      'publish' => array(t('Publish the selected comments'), 'UPDATE {comment} SET status = '. COMMENT_PUBLISHED .' WHERE cid = %d'),
       'delete' => array(t('Delete the selected comments'), '')
     );
   }
   else if ($action == 'unpublish') {
     $operations = array(
-      'unpublish' => array(t('Unpublish the selected comments'), 'UPDATE {comments} SET status = '. COMMENT_NOT_PUBLISHED .' WHERE cid = %d'),
+      'unpublish' => array(t('Unpublish the selected comments'), 'UPDATE {comment} SET status = '. COMMENT_NOT_PUBLISHED .' WHERE cid = %d'),
       'delete' => array(t('Delete the selected comments'), '')
     );
   }
   else {
     $operations = array(
-      'publish' => array(t('Publish the selected comments'), 'UPDATE {comments} SET status = '. COMMENT_PUBLISHED .' WHERE cid = %d'),
-      'unpublish' => array(t('Unpublish the selected comments'), 'UPDATE {comments} SET status = '. COMMENT_NOT_PUBLISHED .' WHERE cid = %d'),
+      'publish' => array(t('Publish the selected comments'), 'UPDATE {comment} SET status = '. COMMENT_PUBLISHED .' WHERE cid = %d'),
+      'unpublish' => array(t('Unpublish the selected comments'), 'UPDATE {comment} SET status = '. COMMENT_NOT_PUBLISHED .' WHERE cid = %d'),
       'delete' => array(t('Delete the selected comments'), '')
     );
   }
@@ -1209,7 +1210,7 @@ function comment_admin_overview($type = 
     array('data' => t('Time'), 'field' => 'timestamp', 'sort' => 'desc'),
     array('data' => t('Operations'))
   ));
-  $result = pager_query('SELECT c.subject, c.nid, c.cid, c.comment, c.timestamp, c.status, c.name, c.homepage, u.name AS registered_name, u.uid FROM {comments} c INNER JOIN {users} u ON u.uid = c.uid WHERE c.status = %d'. tablesort_sql($form['header']['#value']), 50, 0, NULL, $status);
+  $result = pager_query('SELECT c.subject, c.nid, c.cid, c.comment, c.timestamp, c.status, c.name, c.homepage, u.name AS registered_name, u.uid FROM {comment} c INNER JOIN {user} u ON u.uid = c.uid WHERE c.status = %d'. tablesort_sql($form['header']['#value']), 50, 0, NULL, $status);
 
   // build a table listing the appropriate comments
   $destination = drupal_get_destination();
@@ -1304,7 +1305,7 @@ function comment_multiple_delete_confirm
   foreach (array_filter($edit['comments']) as $cid => $value) {
     $comment = _comment_load($cid);
     if (is_object($comment) && is_numeric($comment->cid)) {
-      $subject = db_result(db_query('SELECT subject FROM {comments} WHERE cid = %d', $cid));
+      $subject = db_result(db_query('SELECT subject FROM {comment} WHERE cid = %d', $cid));
       $form['comments'][$cid] = array('#type' => 'hidden', '#value' => $cid, '#prefix' => '<li>', '#suffix' => check_plain($subject) .'</li>');
       $comment_counter++;
     }
@@ -1347,14 +1348,14 @@ function comment_multiple_delete_confirm
  * Load the entire comment by cid.
  */
 function _comment_load($cid) {
-  return db_fetch_object(db_query('SELECT * FROM {comments} WHERE cid = %d', $cid));
+  return db_fetch_object(db_query('SELECT * FROM {comment} WHERE cid = %d', $cid));
 }
 
 function comment_num_all($nid) {
   static $cache;
 
   if (!isset($cache[$nid])) {
-    $cache[$nid] = db_result(db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = %d', $nid));
+    $cache[$nid] = db_result(db_query('SELECT comment_count FROM {node_comment_statistic} WHERE nid = %d', $nid));
   }
   return $cache[$nid];
 }
@@ -1363,7 +1364,7 @@ function comment_num_replies($pid) {
   static $cache;
 
   if (!isset($cache[$pid])) {
-    $cache[$pid] = db_result(db_query('SELECT COUNT(cid) FROM {comments} WHERE pid = %d AND status = %d', $pid, COMMENT_PUBLISHED));
+    $cache[$pid] = db_result(db_query('SELECT COUNT(cid) FROM {comment} WHERE pid = %d AND status = %d', $pid, COMMENT_PUBLISHED));
   }
 
   return $cache[$pid];
@@ -1388,7 +1389,7 @@ function comment_num_new($nid, $timestam
     $timestamp = ($timestamp > NODE_NEW_LIMIT ? $timestamp : NODE_NEW_LIMIT);
 
     // Use the timestamp to retrieve the number of new comments.
-    $result = db_result(db_query('SELECT COUNT(c.cid) FROM {node} n INNER JOIN {comments} c ON n.nid = c.nid WHERE n.nid = %d AND timestamp > %d AND c.status = %d', $nid, $timestamp, COMMENT_PUBLISHED));
+    $result = db_result(db_query('SELECT COUNT(c.cid) FROM {node} n INNER JOIN {comment} c ON n.nid = c.nid WHERE n.nid = %d AND timestamp > %d AND c.status = %d', $nid, $timestamp, COMMENT_PUBLISHED));
 
     return $result;
   }
@@ -1418,7 +1419,7 @@ function comment_validate($edit) {
   if (!$user->uid || isset($edit['is_anonymous'])) {
     if (variable_get('comment_anonymous', COMMENT_ANONYMOUS_MAYNOT_CONTACT) > COMMENT_ANONYMOUS_MAYNOT_CONTACT) {
       if ($edit['name']) {
-        $taken = db_result(db_query("SELECT COUNT(uid) FROM {users} WHERE LOWER(name) = '%s'", $edit['name']), 0);
+        $taken = db_result(db_query("SELECT COUNT(uid) FROM {user} WHERE LOWER(name) = '%s'", $edit['name']), 0);
 
         if ($taken != 0) {
           form_set_error('name', t('The name you used belongs to a registered user.'));
@@ -1669,7 +1670,7 @@ function comment_form_add_preview($form,
   $output = '';
 
   if ($edit['pid']) {
-    $comment = db_fetch_object(db_query('SELECT c.*, u.uid, u.name AS registered_name, u.signature, u.picture, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = %d', $edit['pid'], COMMENT_PUBLISHED));
+    $comment = db_fetch_object(db_query('SELECT c.*, u.uid, u.name AS registered_name, u.signature, u.picture, u.data FROM {comment} c INNER JOIN {user} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = %d', $edit['pid'], COMMENT_PUBLISHED));
     $comment = drupal_unpack($comment);
     $comment->name = $comment->uid ? $comment->registered_name : $comment->name;
     $output .= theme('comment_view', $comment);
@@ -1908,13 +1909,13 @@ function _comment_delete_thread($comment
   }
 
   // Delete the comment:
-  db_query('DELETE FROM {comments} WHERE cid = %d', $comment->cid);
+  db_query('DELETE FROM {comment} WHERE cid = %d', $comment->cid);
   watchdog('content', 'Comment: deleted %subject.', array('%subject' => $comment->subject));
 
   comment_invoke_comment($comment, 'delete');
 
   // Delete the comment's replies
-  $result = db_query('SELECT c.*, u.name AS registered_name, u.uid FROM {comments} c INNER JOIN {users} u ON u.uid = c.uid WHERE pid = %d', $comment->cid);
+  $result = db_query('SELECT c.*, u.name AS registered_name, u.uid FROM {comment} c INNER JOIN {user} u ON u.uid = c.uid WHERE pid = %d', $comment->cid);
   while ($comment = db_fetch_object($result)) {
     $comment->name = $comment->uid ? $comment->registered_name : $comment->name;
     _comment_delete_thread($comment);
@@ -2004,25 +2005,25 @@ function _comment_get_display_setting($s
  * Updates the comment statistics for a given node. This should be called any
  * time a comment is added, deleted, or updated.
  *
- * The following fields are contained in the node_comment_statistics table.
+ * The following fields are contained in the node_comment_statistic table.
  * - last_comment_timestamp: the timestamp of the last comment for this node or the node create stamp if no comments exist for the node.
  * - last_comment_name: the name of the anonymous poster for the last comment
  * - last_comment_uid: the uid of the poster for the last comment for this node or the node authors uid if no comments exists for the node.
  * - comment_count: the total number of approved/published comments on this node.
  */
 function _comment_update_node_statistics($nid) {
-  $count = db_result(db_query('SELECT COUNT(cid) FROM {comments} WHERE nid = %d AND status = %d', $nid, COMMENT_PUBLISHED));
+  $count = db_result(db_query('SELECT COUNT(cid) FROM {comment} WHERE nid = %d AND status = %d', $nid, COMMENT_PUBLISHED));
 
   // comments exist
   if ($count > 0) {
-    $last_reply = db_fetch_object(db_query_range('SELECT cid, name, timestamp, uid FROM {comments} WHERE nid = %d AND status = %d ORDER BY cid DESC', $nid, COMMENT_PUBLISHED, 0, 1));
-    db_query("UPDATE {node_comment_statistics} SET comment_count = %d, last_comment_timestamp = %d, last_comment_name = '%s', last_comment_uid = %d WHERE nid = %d", $count, $last_reply->timestamp, $last_reply->uid ? '' : $last_reply->name, $last_reply->uid, $nid);
+    $last_reply = db_fetch_object(db_query_range('SELECT cid, name, timestamp, uid FROM {comment} WHERE nid = %d AND status = %d ORDER BY cid DESC', $nid, COMMENT_PUBLISHED, 0, 1));
+    db_query("UPDATE {node_comment_statistic} SET comment_count = %d, last_comment_timestamp = %d, last_comment_name = '%s', last_comment_uid = %d WHERE nid = %d", $count, $last_reply->timestamp, $last_reply->uid ? '' : $last_reply->name, $last_reply->uid, $nid);
   }
 
   // no comments
   else {
     $node = db_fetch_object(db_query("SELECT uid, created FROM {node} WHERE nid = %d", $nid));
-    db_query("UPDATE {node_comment_statistics} SET comment_count = 0, last_comment_timestamp = %d, last_comment_name = '', last_comment_uid = %d WHERE nid = %d", $node->created, $node->uid, $nid);
+    db_query("UPDATE {node_comment_statistic} SET comment_count = 0, last_comment_timestamp = %d, last_comment_name = '', last_comment_uid = %d WHERE nid = %d", $node->created, $node->uid, $nid);
   }
 }
 
Index: modules/comment/comment.schema
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.schema,v
retrieving revision 1.1
diff -u -p -r1.1 comment.schema
--- modules/comment/comment.schema	25 May 2007 12:46:44 -0000	1.1
+++ modules/comment/comment.schema	26 May 2007 16:05:51 -0000
@@ -2,7 +2,7 @@
 // $Id: comment.schema,v 1.1 2007/05/25 12:46:44 dries Exp $
 
 function comment_schema() {
-  $schema['comments'] = array(
+  $schema['comment'] = array(
     'fields' => array(
       'cid'       => array('type' => 'serial', 'not null' => TRUE),
       'pid'       => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
@@ -28,7 +28,7 @@ function comment_schema() {
     'primary key' => array('cid'),
   );
 
-  $schema['node_comment_statistics'] = array(
+  $schema['node_comment_statistic'] = array(
     'fields' => array(
       'nid'                    => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
       'last_comment_timestamp' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
Index: modules/dblog/dblog.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/dblog/dblog.module,v
retrieving revision 1.6
diff -u -p -r1.6 dblog.module
--- modules/dblog/dblog.module	14 May 2007 13:43:35 -0000	1.6
+++ modules/dblog/dblog.module	26 May 2007 16:05:51 -0000
@@ -150,7 +150,7 @@ function dblog_overview() {
     array('data' => t('Operations')),
   );
 
-  $sql = "SELECT w.wid, w.uid, w.severity, w.type, w.timestamp, w.message, w.variables, w.link, u.name FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid";
+  $sql = "SELECT w.wid, w.uid, w.severity, w.type, w.timestamp, w.message, w.variables, w.link, u.name FROM {watchdog} w INNER JOIN {user} u ON w.uid = u.uid";
   $tablesort = tablesort_sql($header);
   if (!empty($filter['where'])) {
     $result = pager_query($sql ." WHERE ". $filter['where'] . $tablesort, 50, 0, NULL, $filter['args']);
@@ -219,7 +219,7 @@ function dblog_top($type) {
 function dblog_event($id) {
   $severity = watchdog_severity_levels();
   $output = '';
-  $result = db_query('SELECT w.*, u.name, u.uid FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid WHERE w.wid = %d', $id);
+  $result = db_query('SELECT w.*, u.name, u.uid FROM {watchdog} w INNER JOIN {user} u ON w.uid = u.uid WHERE w.wid = %d', $id);
   if ($dblog = db_fetch_object($result)) {
     $rows = array(
       array(
Index: modules/drupal/drupal.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/drupal/drupal.module,v
retrieving revision 1.144
diff -u -p -r1.144 drupal.module
--- modules/drupal/drupal.module	30 Apr 2007 17:03:24 -0000	1.144
+++ modules/drupal/drupal.module	26 May 2007 16:05:52 -0000
@@ -292,7 +292,7 @@ function drupal_notify($server) {
     }
   }
   if (variable_get('drupal_statistics', 0)) {
-    $users = db_fetch_object(db_query("SELECT COUNT(uid) AS count FROM {users}"));
+    $users = db_fetch_object(db_query("SELECT COUNT(uid) AS count FROM {user}"));
     $client['users'] = $users->count;
     $nodes = db_fetch_object(db_query("SELECT COUNT(nid) AS count FROM {node}"));
     $client['nodes'] = $nodes->count;
Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.174
diff -u -p -r1.174 filter.module
--- modules/filter/filter.module	20 May 2007 16:44:35 -0000	1.174
+++ modules/filter/filter.module	26 May 2007 16:05:53 -0000
@@ -330,7 +330,7 @@ function theme_filter_admin_overview($fo
  */
 function filter_admin_delete() {
   $format = arg(4);
-  $format = db_fetch_object(db_query('SELECT * FROM {filter_formats} WHERE format = %d', $format));
+  $format = db_fetch_object(db_query('SELECT * FROM {filter_format} WHERE format = %d', $format));
 
   if ($format) {
     if ($format->format != variable_get('filter_default_format', 1)) {
@@ -353,14 +353,14 @@ function filter_admin_delete() {
  * Process filter delete form submission.
  */
 function filter_admin_delete_submit($form_values, $form, &$form_state) {
-  db_query("DELETE FROM {filter_formats} WHERE format = %d", $form_values['format']);
-  db_query("DELETE FROM {filters} WHERE format = %d", $form_values['format']);
+  db_query("DELETE FROM {filter_format} WHERE format = %d", $form_values['format']);
+  db_query("DELETE FROM {filter} WHERE format = %d", $form_values['format']);
 
   $default = variable_get('filter_default_format', 1);
   // Replace existing instances of the deleted format with the default format.
-  db_query("UPDATE {node_revisions} SET format = %d WHERE format = %d", $default, $form_values['format']);
-  db_query("UPDATE {comments} SET format = %d WHERE format = %d", $default, $form_values['format']);
-  db_query("UPDATE {boxes} SET format = %d WHERE format = %d", $default, $form_values['format']);
+  db_query("UPDATE {node_revision} SET format = %d WHERE format = %d", $default, $form_values['format']);
+  db_query("UPDATE {comment} SET format = %d WHERE format = %d", $default, $form_values['format']);
+  db_query("UPDATE {box} SET format = %d WHERE format = %d", $default, $form_values['format']);
 
   cache_clear_all($form_values['format'] .':', 'cache_filter', TRUE);
   drupal_set_message(t('Deleted input format %format.', array('%format' => $form_values['name'])));
@@ -445,7 +445,7 @@ function filter_admin_format_form($forma
 function filter_admin_format_form_validate($form_values, $form, &$form_state) {
   if (!isset($form_values['format'])) {
     $name = trim($form_values['name']);
-    $result = db_fetch_object(db_query("SELECT format FROM {filter_formats} WHERE name='%s'", $name));
+    $result = db_fetch_object(db_query("SELECT format FROM {filter_format} WHERE name='%s'", $name));
     if ($result) {
       form_set_error('name', t('Filter format names need to be unique. A format named %name already exists.', array('%name' => $name)));
     }
@@ -464,21 +464,21 @@ function filter_admin_format_form_submit
   // Add a new filter format.
   if (!$format) {
     $new = TRUE;
-    db_query("INSERT INTO {filter_formats} (name) VALUES ('%s')", $name);
-    $format = db_result(db_query("SELECT MAX(format) AS format FROM {filter_formats}"));
+    db_query("INSERT INTO {filter_format} (name) VALUES ('%s')", $name);
+    $format = db_result(db_query("SELECT MAX(format) AS format FROM {filter_format}"));
     drupal_set_message(t('Added input format %format.', array('%format' => $name)));
   }
   else {
     drupal_set_message(t('The input format settings have been updated.'));
   }
 
-  db_query("DELETE FROM {filters} WHERE format = %d", $format);
+  db_query("DELETE FROM {filter} WHERE format = %d", $format);
   foreach ($form_values['filters'] as $id => $checked) {
     if ($checked) {
       list($module, $delta) = explode('/', $id);
       // Add new filters to the bottom.
       $weight = isset($current[$id]->weight) ? $current[$id]->weight : 10;
-      db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (%d, '%s', %d, %d)", $format, $module, $delta, $weight);
+      db_query("INSERT INTO {filter} (format, module, delta, weight) VALUES (%d, '%s', %d, %d)", $format, $module, $delta, $weight);
 
       // Check if there are any 'no cache' filters.
       $cache &= !module_invoke($module, 'filter', 'no cache', $delta);
@@ -498,7 +498,7 @@ function filter_admin_format_form_submit
   }
   $roles = ','. implode(',', ($form_values['default_format'] ? array_keys(user_roles()) : $roles)) .',';
 
-  db_query("UPDATE {filter_formats} SET cache = %d, name='%s', roles = '%s' WHERE format = %d", $cache, $name, $roles, $format);
+  db_query("UPDATE {filter_format} SET cache = %d, name='%s', roles = '%s' WHERE format = %d", $cache, $name, $roles, $format);
 
   cache_clear_all($format .':', 'cache_filter', TRUE);
 
@@ -554,7 +554,7 @@ function theme_filter_admin_order($form)
 function filter_admin_order_submit($form_values, $form, &$form_state) {
   foreach ($form_values['weights'] as $id => $weight) {
     list($module, $delta) = explode('/', $id);
-    db_query("UPDATE {filters} SET weight = %d WHERE format = %d AND module = '%s' AND delta = %d", $weight, $form_values['format'], $module, $delta);
+    db_query("UPDATE {filter} SET weight = %d WHERE format = %d AND module = '%s' AND delta = %d", $weight, $form_values['format'], $module, $delta);
   }
   drupal_set_message(t('The filter ordering has been saved.'));
 
@@ -597,7 +597,7 @@ function filter_formats($index = NULL) {
   if (!isset($formats)) {
     $formats = array();
 
-    $query = 'SELECT * FROM {filter_formats}';
+    $query = 'SELECT * FROM {filter_format}';
 
     // Build query for selecting the format(s) based on the user's roles.
     $args = array();
@@ -662,7 +662,7 @@ function filter_format_allowcache($forma
   static $cache = array();
   $format = filter_resolve_format($format);
   if (!isset($cache[$format])) {
-    $cache[$format] = db_result(db_query('SELECT cache FROM {filter_formats} WHERE format = %d', $format));
+    $cache[$format] = db_result(db_query('SELECT cache FROM {filter_format} WHERE format = %d', $format));
   }
   return $cache[$format];
 }
@@ -675,7 +675,7 @@ function filter_list_format($format) {
 
   if (!isset($filters[$format])) {
     $filters[$format] = array();
-    $result = db_query("SELECT * FROM {filters} WHERE format = %d ORDER BY weight ASC", $format);
+    $result = db_query("SELECT * FROM {filter} WHERE format = %d ORDER BY weight ASC", $format);
     while ($filter = db_fetch_object($result)) {
       $list = module_invoke($filter->module, 'filter', 'list');
       if (isset($list) && is_array($list) && isset($list[$filter->delta])) {
@@ -864,7 +864,7 @@ function _filter_tips($format, $long = F
     $formats = filter_formats();
   }
   else {
-    $formats = array(db_fetch_object(db_query("SELECT * FROM {filter_formats} WHERE format = %d", $format)));
+    $formats = array(db_fetch_object(db_query("SELECT * FROM {filter_format} WHERE format = %d", $format)));
   }
 
   $tips = array();
Index: modules/filter/filter.schema
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.schema,v
retrieving revision 1.1
diff -u -p -r1.1 filter.schema
--- modules/filter/filter.schema	25 May 2007 12:46:44 -0000	1.1
+++ modules/filter/filter.schema	26 May 2007 16:05:53 -0000
@@ -2,7 +2,7 @@
 // $Id: filter.schema,v 1.1 2007/05/25 12:46:44 dries Exp $
 
 function filter_schema() {
-  $schema['filters'] = array(
+  $schema['filter'] = array(
     'fields' => array(
       'fid'    => array('type' => 'serial', 'not null' => TRUE),
       'format' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
@@ -13,7 +13,7 @@ function filter_schema() {
     'primary key' => array('fid'),
     'indexes' => array('weight' => array('weight')),
   );
-  $schema['filter_formats'] = array(
+  $schema['filter_format'] = array(
     'fields' => array(
       'format' => array('type' => 'serial', 'not null' => TRUE),
       'name'   => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
Index: modules/forum/forum.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v
retrieving revision 1.397
diff -u -p -r1.397 forum.module
--- modules/forum/forum.module	14 May 2007 13:43:36 -0000	1.397
+++ modules/forum/forum.module	26 May 2007 16:05:54 -0000
@@ -286,7 +286,7 @@ function forum_block($op = 'list', $delt
         switch ($delta) {
           case 0:
             $title = t('Active forum topics');
-            $sql = db_rewrite_sql("SELECT n.nid, n.title, l.comment_count, l.last_comment_timestamp FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid WHERE n.status = 1 AND n.type = 'forum' ORDER BY l.last_comment_timestamp DESC");
+            $sql = db_rewrite_sql("SELECT n.nid, n.title, l.comment_count, l.last_comment_timestamp FROM {node} n INNER JOIN {node_comment_statistic} l ON n.nid = l.nid WHERE n.status = 1 AND n.type = 'forum' ORDER BY l.last_comment_timestamp DESC");
             $result = db_query_range($sql, 0, variable_get('forum_block_num_0', '5'));
             if (db_num_rows($result)) {
               $content = node_title_list($result);
@@ -295,7 +295,7 @@ function forum_block($op = 'list', $delt
 
           case 1:
             $title = t('New forum topics');
-            $sql = db_rewrite_sql("SELECT n.nid, n.title, l.comment_count FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid WHERE n.type = 'forum' AND n.status = 1 ORDER BY n.nid DESC");
+            $sql = db_rewrite_sql("SELECT n.nid, n.title, l.comment_count FROM {node} n INNER JOIN {node_comment_statistic} l ON n.nid = l.nid WHERE n.type = 'forum' AND n.status = 1 ORDER BY n.nid DESC");
             $result = db_query_range($sql, 0, variable_get('forum_block_num_1', '5'));
             if (db_num_rows($result)) {
               $content = node_title_list($result);
@@ -387,7 +387,7 @@ function forum_validate($node) {
     $vocabulary = variable_get('forum_nav_vocabulary', '');
     $containers = variable_get('forum_containers', array());
     foreach ($node->taxonomy as $term) {
-      if (db_result(db_query('SELECT COUNT(*) FROM {term_data} WHERE tid = %d AND vid = %d', $term, $vocabulary))) {
+      if (db_result(db_query('SELECT COUNT(*) FROM {term} WHERE tid = %d AND vid = %d', $term, $vocabulary))) {
         if (in_array($term, $containers)) {
           $term = taxonomy_get_term($term);
           form_set_error('taxonomy', t('The item %forum is only a container for forums. Please select one of the forums below it.', array('%forum' => $term->name)));
@@ -762,7 +762,7 @@ function forum_get_forums($tid = 0) {
 
     $counts = array();
 
-    $sql = "SELECT r.tid, COUNT(n.nid) AS topic_count, SUM(l.comment_count) AS comment_count FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid INNER JOIN {term_node} r ON n.nid = r.nid WHERE n.status = 1 AND n.type = 'forum' GROUP BY r.tid";
+    $sql = "SELECT r.tid, COUNT(n.nid) AS topic_count, SUM(l.comment_count) AS comment_count FROM {node} n INNER JOIN {node_comment_statistic} l ON n.nid = l.nid INNER JOIN {term_node} r ON n.nid = r.nid WHERE n.status = 1 AND n.type = 'forum' GROUP BY r.tid";
     $sql = db_rewrite_sql($sql);
     $_counts = db_query($sql, $forum->tid);
     while ($count = db_fetch_object($_counts)) {
@@ -786,8 +786,8 @@ function forum_get_forums($tid = 0) {
 
     // This query does not use full ANSI syntax since MySQL 3.x does not support
     // table1 INNER JOIN table2 INNER JOIN table3 ON table2_criteria ON table3_criteria
-    // used to join node_comment_statistics to users.
-    $sql = "SELECT ncs.last_comment_timestamp, IF (ncs.last_comment_uid != 0, u2.name, ncs.last_comment_name) AS last_comment_name, ncs.last_comment_uid FROM {node} n INNER JOIN {users} u1 ON n.uid = u1.uid INNER JOIN {term_node} tn ON n.nid = tn.nid INNER JOIN {node_comment_statistics} ncs ON n.nid = ncs.nid INNER JOIN {users} u2 ON ncs.last_comment_uid=u2.uid WHERE n.status = 1 AND n.type='forum' AND tn.tid = %d ORDER BY ncs.last_comment_timestamp DESC";
+    // used to join node_comment_statistic to users.
+    $sql = "SELECT ncs.last_comment_timestamp, IF (ncs.last_comment_uid != 0, u2.name, ncs.last_comment_name) AS last_comment_name, ncs.last_comment_uid FROM {node} n INNER JOIN {user} u1 ON n.uid = u1.uid INNER JOIN {term_node} tn ON n.nid = tn.nid INNER JOIN {node_comment_statistic} ncs ON n.nid = ncs.nid INNER JOIN {user} u2 ON ncs.last_comment_uid=u2.uid WHERE n.status = 1 AND n.type='forum' AND tn.tid = %d ORDER BY ncs.last_comment_timestamp DESC";
     $sql = db_rewrite_sql($sql);
     $topic = db_fetch_object(db_query_range($sql, $forum->tid, 0, 1));
 
@@ -833,7 +833,7 @@ function forum_get_topics($tid, $sortby,
 
   $term = taxonomy_get_term($tid);
 
-  $sql = db_rewrite_sql("SELECT n.nid, f.tid, n.title, n.sticky, u.name, u.uid, n.created AS timestamp, n.comment AS comment_mode, l.last_comment_timestamp, IF(l.last_comment_uid != 0, cu.name, l.last_comment_name) AS last_comment_name, l.last_comment_uid, l.comment_count AS num_comments FROM {node_comment_statistics} l, {users} cu, {term_node} r, {users} u, {forum} f, {node} n WHERE n.status = 1 AND l.last_comment_uid = cu.uid AND n.nid = l.nid AND n.nid = r.nid AND r.tid = %d AND n.uid = u.uid AND n.vid = f.vid");
+  $sql = db_rewrite_sql("SELECT n.nid, f.tid, n.title, n.sticky, u.name, u.uid, n.created AS timestamp, n.comment AS comment_mode, l.last_comment_timestamp, IF(l.last_comment_uid != 0, cu.name, l.last_comment_name) AS last_comment_name, l.last_comment_uid, l.comment_count AS num_comments FROM {node_comment_statistic} l, {user} cu, {term_node} r, {user} u, {forum} f, {node} n WHERE n.status = 1 AND l.last_comment_uid = cu.uid AND n.nid = l.nid AND n.nid = r.nid AND r.tid = %d AND n.uid = u.uid AND n.vid = f.vid");
   $sql .= tablesort_sql($forum_topic_list_header, 'n.sticky DESC,');
   $sql .= ', n.created DESC';  // Always add a secondary sort order so that the news forum topics are on top.
 
@@ -1110,7 +1110,7 @@ function theme_forum_topic_navigation($n
   $output = '';
 
   // get previous and next topic
-  $sql = "SELECT n.nid, n.title, n.sticky, l.comment_count, l.last_comment_timestamp FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid INNER JOIN {term_node} r ON n.nid = r.nid AND r.tid = %d WHERE n.status = 1 AND n.type = 'forum' ORDER BY n.sticky DESC, ". _forum_get_topic_order_sql(variable_get('forum_order', 1));
+  $sql = "SELECT n.nid, n.title, n.sticky, l.comment_count, l.last_comment_timestamp FROM {node} n INNER JOIN {node_comment_statistic} l ON n.nid = l.nid INNER JOIN {term_node} r ON n.nid = r.nid AND r.tid = %d WHERE n.status = 1 AND n.type = 'forum' ORDER BY n.sticky DESC, ". _forum_get_topic_order_sql(variable_get('forum_order', 1));
   $result = db_query(db_rewrite_sql($sql), isset($node->tid) ? $node->tid : 0);
 
   $stop = 0;
Index: modules/locale/locale.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.install,v
retrieving revision 1.11
diff -u -p -r1.11 locale.install
--- modules/locale/locale.install	25 May 2007 15:47:56 -0000	1.11
+++ modules/locale/locale.install	26 May 2007 16:05:54 -0000
@@ -12,7 +12,7 @@ function locale_install() {
   // Create tables.
   drupal_install_schema('locale');
 
-  db_query("INSERT INTO {languages} (language, name, native, direction, enabled, weight) VALUES ('en', 'English', 'English', '0', '1', '0')");
+  db_query("INSERT INTO {language} (language, name, native, direction, enabled, weight) VALUES ('en', 'English', 'English', '0', '1', '0')");
 }
 
 /**
@@ -21,14 +21,14 @@ function locale_install() {
  */
 
 /**
- * {locales_meta} table became {languages}.
+ * {locales_meta} table became {language}.
  */
 function locale_update_6001() {
   $ret = array();
   switch ($GLOBALS['db_type']) {
     case 'mysql':
     case 'mysqli':
-      $ret[] = update_sql("CREATE TABLE {languages} (
+      $ret[] = update_sql("CREATE TABLE {language} (
         language varchar(12) NOT NULL default '',
         name varchar(64) NOT NULL default '',
         native varchar(64) NOT NULL default '',
@@ -43,7 +43,7 @@ function locale_update_6001() {
       ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
       break;
     case 'pgsql':
-      $ret[] = update_sql("CREATE TABLE {languages} (
+      $ret[] = update_sql("CREATE TABLE {language} (
         language varchar(12) NOT NULL default '',
         name varchar(64) NOT NULL default '',
         native varchar(64) NOT NULL default '',
@@ -60,10 +60,10 @@ function locale_update_6001() {
   }
 
   // Save the languages
-  $ret[] = update_sql("INSERT INTO {languages} (language, name, native, direction, enabled, plurals, formula, domain, prefix, weight) SELECT locale, name, '', 0, enabled, plurals, formula, '', locale, 0 FROM {locales_meta}");
+  $ret[] = update_sql("INSERT INTO {language} (language, name, native, direction, enabled, plurals, formula, domain, prefix, weight) SELECT locale, name, '', 0, enabled, plurals, formula, '', locale, 0 FROM {locales_meta}");
 
   // Save the language count in the variable table
-  $count = db_result(db_query('SELECT COUNT(*) FROM {languages} WHERE enabled = 1'));
+  $count = db_result(db_query('SELECT COUNT(*) FROM {language} WHERE enabled = 1'));
   variable_set('language_count', $count);
 
   // Save the default language in the variable table
Index: modules/locale/locale.schema
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.schema,v
retrieving revision 1.1
diff -u -p -r1.1 locale.schema
--- modules/locale/locale.schema	25 May 2007 12:46:44 -0000	1.1
+++ modules/locale/locale.schema	26 May 2007 16:05:54 -0000
@@ -2,7 +2,7 @@
 // $Id: locale.schema,v 1.1 2007/05/25 12:46:44 dries Exp $
 
 function locale_schema() {
-  $schema['languages'] = array(
+  $schema['language'] = array(
     'fields' => array(
       'language'  => array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => ''),
       'name'      => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''),
Index: modules/menu/menu.schema
===================================================================
RCS file: /cvs/drupal/drupal/modules/menu/menu.schema,v
retrieving revision 1.2
diff -u -p -r1.2 menu.schema
--- modules/menu/menu.schema	25 May 2007 20:52:44 -0000	1.2
+++ modules/menu/menu.schema	26 May 2007 16:05:54 -0000
@@ -32,7 +32,7 @@ function menu_schema() {
     'primary key' => array('path'),
   );
 
-  $schema['menu_links'] = array(
+  $schema['menu_link'] = array(
     'fields' => array(
       'menu_name'    => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''),
       'mlid'         => array('type' => 'serial', 'not null' => TRUE),
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.819
diff -u -p -r1.819 node.module
--- modules/node/node.module	23 May 2007 07:55:08 -0000	1.819
+++ modules/node/node.module	26 May 2007 16:05:56 -0000
@@ -88,7 +88,7 @@ function node_cron() {
  * Gather a listing of links to nodes.
  *
  * @param $result
- *   A DB result object from a query to fetch node objects. If your query joins the <code>node_comment_statistics</code> table so that the <code>comment_count</code> field is available, a title attribute will be added to show the number of comments.
+ *   A DB result object from a query to fetch node objects. If your query joins the <code>node_comment_statistic</code> table so that the <code>comment_count</code> field is available, a title attribute will be added to show the number of comments.
  * @param $title
  *   A heading for the resulting list.
  *
@@ -581,10 +581,10 @@ function node_load($param = array(), $re
   // No db_rewrite_sql is applied so as to get complete indexing for search.
   if ($revision) {
     array_unshift($arguments, $revision);
-    $node = db_fetch_object(db_query('SELECT n.nid, r.vid, n.type, n.status, n.language, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM {node} n INNER JOIN {users} u ON u.uid = n.uid INNER JOIN {node_revisions} r ON r.nid = n.nid AND r.vid = %d WHERE '. $cond, $arguments));
+    $node = db_fetch_object(db_query('SELECT n.nid, r.vid, n.type, n.status, n.language, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM {node} n INNER JOIN {user} u ON u.uid = n.uid INNER JOIN {node_revision} r ON r.nid = n.nid AND r.vid = %d WHERE '. $cond, $arguments));
   }
   else {
-    $node = db_fetch_object(db_query('SELECT n.nid, n.vid, n.type, n.status, n.language, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM {node} n INNER JOIN {users} u ON u.uid = n.uid INNER JOIN {node_revisions} r ON r.vid = n.vid WHERE '. $cond, $arguments));
+    $node = db_fetch_object(db_query('SELECT n.nid, n.vid, n.type, n.status, n.language, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM {node} n INNER JOIN {user} u ON u.uid = n.uid INNER JOIN {node_revision} r ON r.vid = n.vid WHERE '. $cond, $arguments));
   }
 
   if ($node && $node->nid) {
@@ -623,7 +623,7 @@ function node_save(&$node) {
     $node->is_new = TRUE;
 
     $node->nid = db_next_id('{node}_nid');
-    $node->vid = db_next_id('{node_revisions}_vid');
+    $node->vid = db_next_id('{node_revision}_vid');
   }
   else {
     // We need to ensure that all node fields are filled.
@@ -635,7 +635,7 @@ function node_save(&$node) {
 
     if (!empty($node->revision)) {
       $node->old_vid = $node->vid;
-      $node->vid = db_next_id('{node_revisions}_vid');
+      $node->vid = db_next_id('{node_revision}_vid');
     }
   }
 
@@ -677,7 +677,7 @@ function node_save(&$node) {
   //the node_revisions table query
   if ($node->is_new) {
     $node_query = 'INSERT INTO {node} ('. implode(', ', array_keys($node_table_types)) .') VALUES ('. implode(', ', $node_table_types) .')';
-    $revisions_query = 'INSERT INTO {node_revisions} ('. implode(', ', array_keys($revisions_table_types)) .') VALUES ('. implode(', ', $revisions_table_types) .')';
+    $revisions_query = 'INSERT INTO {node_revision} ('. implode(', ', array_keys($revisions_table_types)) .') VALUES ('. implode(', ', $revisions_table_types) .')';
   }
   else {
     $arr = array();
@@ -687,7 +687,7 @@ function node_save(&$node) {
     $node_table_values[] = $node->nid;
     $node_query = 'UPDATE {node} SET '. implode(', ', $arr) .' WHERE nid = %d';
     if (!empty($node->revision)) {
-      $revisions_query = 'INSERT INTO {node_revisions} ('. implode(', ', array_keys($revisions_table_types)) .') VALUES ('. implode(', ', $revisions_table_types) .')';
+      $revisions_query = 'INSERT INTO {node_revision} ('. implode(', ', array_keys($revisions_table_types)) .') VALUES ('. implode(', ', $revisions_table_types) .')';
     }
     else {
       $arr = array();
@@ -695,7 +695,7 @@ function node_save(&$node) {
         $arr[] = $key .' = '. $value;
       }
       $revisions_table_values[] = $node->vid;
-      $revisions_query = 'UPDATE {node_revisions} SET '. implode(', ', $arr) .' WHERE vid = %d';
+      $revisions_query = 'UPDATE {node_revision} SET '. implode(', ', $arr) .' WHERE vid = %d';
     }
   }
 
@@ -871,7 +871,7 @@ function node_search($op = 'search', $ke
       $last = variable_get('node_cron_last', 0);
       $last_nid = variable_get('node_cron_last_nid', 0);
       $total = db_result(db_query('SELECT COUNT(*) FROM {node} WHERE status = 1'));
-      $remaining = db_result(db_query('SELECT COUNT(*) FROM {node} n LEFT JOIN {node_comment_statistics} c ON n.nid = c.nid WHERE n.status = 1 AND ((GREATEST(n.created, n.changed, c.last_comment_timestamp) = %d AND n.nid > %d ) OR (n.created > %d OR n.changed > %d OR c.last_comment_timestamp > %d))', $last, $last_nid, $last, $last, $last));
+      $remaining = db_result(db_query('SELECT COUNT(*) FROM {node} n LEFT JOIN {node_comment_statistic} c ON n.nid = c.nid WHERE n.status = 1 AND ((GREATEST(n.created, n.changed, c.last_comment_timestamp) = %d AND n.nid > %d ) OR (n.created > %d OR n.changed > %d OR c.last_comment_timestamp > %d))', $last, $last_nid, $last, $last, $last));
       return array('remaining' => $remaining, 'total' => $total);
 
     case 'admin':
@@ -929,7 +929,7 @@ function node_search($op = 'search', $ke
       $ranking = array();
       $arguments2 = array();
       $join2 = '';
-      // Used to avoid joining on node_comment_statistics twice
+      // Used to avoid joining on node_comment_statistic twice
       $stats_join = FALSE;
       $total = 0;
       if ($weight = (int)variable_get('node_rank_relevance', 5)) {
@@ -943,7 +943,7 @@ function node_search($op = 'search', $ke
         $ranking[] = '%d * POW(2, (GREATEST(n.created, n.changed, c.last_comment_timestamp) - %d) * 6.43e-8)';
         $arguments2[] = $weight;
         $arguments2[] = (int)variable_get('node_cron_last', 0);
-        $join2 .= ' INNER JOIN {node} n ON n.nid = i.sid LEFT JOIN {node_comment_statistics} c ON c.nid = i.sid';
+        $join2 .= ' INNER JOIN {node} n ON n.nid = i.sid LEFT JOIN {node_comment_statistic} c ON c.nid = i.sid';
         $stats_join = TRUE;
         $total += $weight;
       }
@@ -954,7 +954,7 @@ function node_search($op = 'search', $ke
         $arguments2[] = $weight;
         $arguments2[] = $scale;
         if (!$stats_join) {
-          $join2 .= ' LEFT JOIN {node_comment_statistics} c ON c.nid = i.sid';
+          $join2 .= ' LEFT JOIN {node_comment_statistic} c ON c.nid = i.sid';
         }
         $total += $weight;
       }
@@ -971,7 +971,7 @@ function node_search($op = 'search', $ke
       $select2 = (count($ranking) ? implode(' + ', $ranking) : 'i.relevance') .' AS score';
 
       // Do search
-      $find = do_search($keys, 'node', 'INNER JOIN {node} n ON n.nid = i.sid '. $join1 .' INNER JOIN {users} u ON n.uid = u.uid', $conditions1 . (empty($where1) ? '' : ' AND '. $where1), $arguments1, $select2, $join2, $arguments2);
+      $find = do_search($keys, 'node', 'INNER JOIN {node} n ON n.nid = i.sid '. $join1 .' INNER JOIN {user} u ON n.uid = u.uid', $conditions1 . (empty($where1) ? '' : ' AND '. $where1), $arguments1, $select2, $join2, $arguments2);
 
       // Load results
       $results = array();
@@ -1007,7 +1007,7 @@ function node_search($op = 'search', $ke
 function node_user($op, &$edit, &$user) {
   if ($op == 'delete') {
     db_query('UPDATE {node} SET uid = 0 WHERE uid = %d', $user->uid);
-    db_query('UPDATE {node_revisions} SET uid = 0 WHERE uid = %d', $user->uid);
+    db_query('UPDATE {node_revision} SET uid = 0 WHERE uid = %d', $user->uid);
   }
 }
 
@@ -1121,7 +1121,7 @@ function node_link($type, $node = NULL, 
 }
 
 function _node_revision_access($node) {
-  return (user_access('view revisions') || user_access('administer nodes')) && node_access('view', $node) && db_result(db_query('SELECT COUNT(vid) FROM {node_revisions} WHERE nid = %d', $node->nid)) > 1;
+  return (user_access('view revisions') || user_access('administer nodes')) && node_access('view', $node) && db_result(db_query('SELECT COUNT(vid) FROM {node_revision} WHERE nid = %d', $node->nid)) > 1;
 }
 
 /**
@@ -1594,7 +1594,7 @@ function node_admin_content() {
 function node_admin_nodes() {
   $filter = node_build_filter_query();
 
-  $result = pager_query('SELECT n.*, u.name, u.uid FROM {node} n '. $filter['join'] .' INNER JOIN {users} u ON n.uid = u.uid '. $filter['where'] .' ORDER BY n.changed DESC', 50, 0, NULL, $filter['args']);
+  $result = pager_query('SELECT n.*, u.name, u.uid FROM {node} n '. $filter['join'] .' INNER JOIN {user} u ON n.uid = u.uid '. $filter['where'] .' ORDER BY n.changed DESC', 50, 0, NULL, $filter['args']);
 
   // Enable language column if locale is enabled or if we have any node with language
   $count = db_result(db_query("SELECT COUNT(*) FROM {node} n WHERE language != ''"));
@@ -1787,7 +1787,7 @@ function node_revision_delete($nid, $rev
       if ($revision != $node->vid) {
         $node = node_load($nid, $revision);
 
-        db_query("DELETE FROM {node_revisions} WHERE nid = %d AND vid = %d", $nid, $revision);
+        db_query("DELETE FROM {node_revision} WHERE nid = %d AND vid = %d", $nid, $revision);
         node_invoke_nodeapi($node, 'delete revision');
         drupal_set_message(t('Deleted %title revision %revision.', array('%title' => $node->title, '%revision' => $revision)));
         watchdog('content', '@type: deleted %title revision %revision.', array('@type' => $node->type, '%title' => $node->title, '%revision' => $revision));
@@ -1796,7 +1796,7 @@ function node_revision_delete($nid, $rev
       else {
         drupal_set_message(t('Deletion failed. You tried to delete the current revision.'));
       }
-      if (db_result(db_query('SELECT COUNT(vid) FROM {node_revisions} WHERE nid = %d', $nid)) > 1) {
+      if (db_result(db_query('SELECT COUNT(vid) FROM {node_revision} WHERE nid = %d', $nid)) > 1) {
         drupal_goto("node/$nid/revisions");
       }
       else {
@@ -1813,7 +1813,7 @@ function node_revision_delete($nid, $rev
  */
 function node_revision_list($node) {
   $revisions = array();
-  $result = db_query('SELECT r.vid, r.title, r.log, r.uid, n.vid AS current_vid, r.timestamp, u.name FROM {node_revisions} r LEFT JOIN {node} n ON n.vid = r.vid INNER JOIN {users} u ON u.uid = r.uid WHERE r.nid = %d ORDER BY r.timestamp DESC', $node->nid);
+  $result = db_query('SELECT r.vid, r.title, r.log, r.uid, n.vid AS current_vid, r.timestamp, u.name FROM {node_revision} r LEFT JOIN {node} n ON n.vid = r.vid INNER JOIN {user} u ON u.uid = r.uid WHERE r.nid = %d ORDER BY r.timestamp DESC', $node->nid);
   while ($revision = db_fetch_object($result)) {
     $revisions[$revision->vid] = $revision;
   }
@@ -2386,7 +2386,7 @@ function node_delete($nid) {
 
   if (node_access('delete', $node)) {
     db_query('DELETE FROM {node} WHERE nid = %d', $node->nid);
-    db_query('DELETE FROM {node_revisions} WHERE nid = %d', $node->nid);
+    db_query('DELETE FROM {node_revision} WHERE nid = %d', $node->nid);
 
     // Call the node-specific callback (if any):
     node_invoke($node, 'delete');
@@ -2460,7 +2460,7 @@ function node_page_default() {
   }
   else {
     // Check for existence of admin account.
-    $admin = db_result(db_query('SELECT uid FROM {users} WHERE uid = 1'));
+    $admin = db_result(db_query('SELECT uid FROM {user} WHERE uid = 1'));
 
     $default_message = t('<h1 class="title">Welcome to your new Drupal website!</h1><p>Please follow these steps to set up and start using your website:</p>');
     $default_message .= '<ol>';
@@ -2530,10 +2530,10 @@ function node_update_index() {
   $limit = (int)variable_get('search_cron_limit', 100);
 
   // Store the maximum possible comments per thread (used for ranking by reply count)
-  variable_set('node_cron_comments_scale', 1.0 / max(1, db_result(db_query('SELECT MAX(comment_count) FROM {node_comment_statistics}'))));
+  variable_set('node_cron_comments_scale', 1.0 / max(1, db_result(db_query('SELECT MAX(comment_count) FROM {node_comment_statistic}'))));
   variable_set('node_cron_views_scale', 1.0 / max(1, db_result(db_query('SELECT MAX(totalcount) FROM {node_counter}'))));
 
-  $result = db_query_range('SELECT GREATEST(IF(c.last_comment_timestamp IS NULL, 0, c.last_comment_timestamp), n.changed) as last_change, n.nid FROM {node} n LEFT JOIN {node_comment_statistics} c ON n.nid = c.nid WHERE n.status = 1 AND ((GREATEST(n.changed, c.last_comment_timestamp) = %d AND n.nid > %d) OR (n.changed > %d OR c.last_comment_timestamp > %d)) ORDER BY GREATEST(n.changed, c.last_comment_timestamp) ASC, n.nid ASC', $last, $last_nid, $last, $last, $last, 0, $limit);
+  $result = db_query_range('SELECT GREATEST(IF(c.last_comment_timestamp IS NULL, 0, c.last_comment_timestamp), n.changed) as last_change, n.nid FROM {node} n LEFT JOIN {node_comment_statistic} c ON n.nid = c.nid WHERE n.status = 1 AND ((GREATEST(n.changed, c.last_comment_timestamp) = %d AND n.nid > %d) OR (n.changed > %d OR c.last_comment_timestamp > %d)) ORDER BY GREATEST(n.changed, c.last_comment_timestamp) ASC, n.nid ASC', $last, $last_nid, $last, $last, $last, 0, $limit);
 
   while ($node = db_fetch_object($result)) {
     $last_change = $node->last_change;
Index: modules/node/node.schema
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.schema,v
retrieving revision 1.1
diff -u -p -r1.1 node.schema
--- modules/node/node.schema	25 May 2007 12:46:45 -0000	1.1
+++ modules/node/node.schema	26 May 2007 16:05:56 -0000
@@ -63,7 +63,7 @@ function node_schema() {
     'primary key' => array('nid'),
   );
 
-  $schema['node_revisions'] = array(
+  $schema['node_revision'] = array(
     'fields' => array(
       'nid'       => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
       'vid'       => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
Index: modules/php/php.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/php/php.install,v
retrieving revision 1.1
diff -u -p -r1.1 php.install
--- modules/php/php.install	24 Apr 2007 10:54:34 -0000	1.1
+++ modules/php/php.install	26 May 2007 16:05:56 -0000
@@ -5,17 +5,17 @@
  * Implementation of hook_install().
  */
 function php_install() {
-  $format_exists = db_result(db_query("SELECT COUNT(*) FROM {filter_formats} WHERE name = 'PHP code'"));
+  $format_exists = db_result(db_query("SELECT COUNT(*) FROM {filter_format} WHERE name = 'PHP code'"));
   // Add a PHP code input format, if it does not exist. Do this only for the
   // first install (or if the format has been manually deleted) as there is no
   // reliable method to identify the format in an uninstall hook or in
   // subsequent clean installs.
   if (!$format_exists) {
-    db_query("INSERT INTO {filter_formats} (name, roles, cache) VALUES ('PHP code', '', 0)");
-    $format = db_result(db_query("SELECT MAX(format) FROM {filter_formats}"));
+    db_query("INSERT INTO {filter_format} (name, roles, cache) VALUES ('PHP code', '', 0)");
+    $format = db_result(db_query("SELECT MAX(format) FROM {filter_format}"));
 
     // Enable the PHP evaluator filter.
-    db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (%d, 'php', 0, 0)", $format);
+    db_query("INSERT INTO {filter} (format, module, delta, weight) VALUES (%d, 'php', 0, 0)", $format);
 
     drupal_set_message(t('A !php-code input format has been created.', array('!php-code' => l('PHP code', 'admin/settings/filters/'. $format))));
   }
Index: modules/poll/poll.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.module,v
retrieving revision 1.229
diff -u -p -r1.229 poll.module
--- modules/poll/poll.module	25 May 2007 15:04:42 -0000	1.229
+++ modules/poll/poll.module	26 May 2007 16:05:56 -0000
@@ -92,8 +92,8 @@ function poll_cron() {
  */
 function poll_delete($node) {
   db_query("DELETE FROM {poll} WHERE nid = %d", $node->nid);
-  db_query("DELETE FROM {poll_choices} WHERE nid = %d", $node->nid);
-  db_query("DELETE FROM {poll_votes} WHERE nid = %d", $node->nid);
+  db_query("DELETE FROM {poll_choice} WHERE nid = %d", $node->nid);
+  db_query("DELETE FROM {poll_vote} WHERE nid = %d", $node->nid);
 }
 
 /**
@@ -237,7 +237,7 @@ function poll_insert($node) {
 
   foreach ($node->choice as $choice) {
     if ($choice['chtext'] != '') {
-      db_query("INSERT INTO {poll_choices} (nid, chtext, chvotes, chorder) VALUES (%d, '%s', %d, %d)", $node->nid, $choice['chtext'], $choice['chvotes'], $i++);
+      db_query("INSERT INTO {poll_choice} (nid, chtext, chvotes, chorder) VALUES (%d, '%s', %d, %d)", $node->nid, $choice['chtext'], $choice['chvotes'], $i++);
     }
   }
 }
@@ -296,7 +296,7 @@ function poll_load($node) {
   // Load the appropriate choices into the $node object
   $poll = db_fetch_object(db_query("SELECT runtime, active FROM {poll} WHERE nid = %d", $node->nid));
 
-  $result = db_query("SELECT chtext, chvotes, chorder FROM {poll_choices} WHERE nid = %d ORDER BY chorder", $node->nid);
+  $result = db_query("SELECT chtext, chvotes, chorder FROM {poll_choice} WHERE nid = %d ORDER BY chorder", $node->nid);
   while ($choice = db_fetch_array($result)) {
     $poll->choice[$choice['chorder']] = $choice;
   }
@@ -305,10 +305,10 @@ function poll_load($node) {
   $poll->allowvotes = FALSE;
   if (user_access('vote on polls') && $poll->active) {
     if ($user->uid) {
-      $result = db_fetch_object(db_query('SELECT chorder FROM {poll_votes} WHERE nid = %d AND uid = %d', $node->nid, $user->uid));
+      $result = db_fetch_object(db_query('SELECT chorder FROM {poll_vote} WHERE nid = %d AND uid = %d', $node->nid, $user->uid));
     }
     else {
-      $result = db_fetch_object(db_query("SELECT chorder FROM {poll_votes} WHERE nid = %d AND hostname = '%s'", $node->nid, ip_address()));
+      $result = db_fetch_object(db_query("SELECT chorder FROM {poll_vote} WHERE nid = %d AND hostname = '%s'", $node->nid, ip_address()));
     }
     if (isset($result->chorder)) {
       $poll->vote = $result->chorder;
@@ -338,7 +338,7 @@ function poll_node_info() {
 
 function poll_page() {
   // List all polls
-  $sql = "SELECT n.nid, n.title, p.active, n.created, SUM(c.chvotes) AS votes FROM {node} n INNER JOIN {poll} p ON n.nid = p.nid INNER JOIN {poll_choices} c ON n.nid = c.nid WHERE n.status = 1 GROUP BY n.nid, n.title, p.active, n.created ORDER BY n.created DESC";
+  $sql = "SELECT n.nid, n.title, p.active, n.created, SUM(c.chvotes) AS votes FROM {node} n INNER JOIN {poll} p ON n.nid = p.nid INNER JOIN {poll_choice} c ON n.nid = c.nid WHERE n.status = 1 GROUP BY n.nid, n.title, p.active, n.created ORDER BY n.created DESC";
   $sql = db_rewrite_sql($sql);
   $result = pager_query($sql, 15);
   $output = '<ul>';
@@ -499,7 +499,7 @@ function poll_votes() {
     $header[] = array('data' => t('Visitor'), 'field' => 'u.name');
     $header[] = array('data' => t('Vote'), 'field' => 'pv.chorder');
 
-    $result = pager_query("SELECT pv.chorder, pv.uid, pv.hostname, u.name FROM {poll_votes} pv LEFT JOIN {users} u ON pv.uid = u.uid WHERE pv.nid = %d" . tablesort_sql($header), 20, 0, NULL, $node->nid);
+    $result = pager_query("SELECT pv.chorder, pv.uid, pv.hostname, u.name FROM {poll_vote} pv LEFT JOIN {user} u ON pv.uid = u.uid WHERE pv.nid = %d" . tablesort_sql($header), 20, 0, NULL, $node->nid);
     $rows = array();
     while ($vote = db_fetch_object($result)) {
       $rows[] = array(
@@ -531,14 +531,14 @@ function poll_vote(&$node) {
       if ($node->allowvotes) {
         // Record the vote by this user or host.
         if ($user->uid) {
-          db_query('INSERT INTO {poll_votes} (nid, chorder, uid) VALUES (%d, %d, %d)', $node->nid, $choice, $user->uid);
+          db_query('INSERT INTO {poll_vote} (nid, chorder, uid) VALUES (%d, %d, %d)', $node->nid, $choice, $user->uid);
         }
         else {
-          db_query("INSERT INTO {poll_votes} (nid, chorder, hostname) VALUES (%d, %d, '%s')", $node->nid, $choice, ip_address());
+          db_query("INSERT INTO {poll_vote} (nid, chorder, hostname) VALUES (%d, %d, '%s')", $node->nid, $choice, ip_address());
         }
 
         // Add one to the votes.
-        db_query("UPDATE {poll_choices} SET chvotes = chvotes + 1 WHERE nid = %d AND chorder = %d", $node->nid, $choice);
+        db_query("UPDATE {poll_choice} SET chvotes = chvotes + 1 WHERE nid = %d AND chorder = %d", $node->nid, $choice);
 
         $node->allowvotes = FALSE;
         $node->choice[$choice]['chvotes']++;
@@ -570,14 +570,14 @@ function poll_cancel(&$node) {
   if ($node = node_load($nid)) {
     if ($node->type == 'poll' && $node->allowvotes == FALSE) {
       if ($user->uid) {
-        db_query('DELETE FROM {poll_votes} WHERE nid = %d and uid = %d', $node->nid, $user->uid);
+        db_query('DELETE FROM {poll_vote} WHERE nid = %d and uid = %d', $node->nid, $user->uid);
       }
       else {
-        db_query("DELETE FROM {poll_votes} WHERE nid = %d and hostname = '%s'", $node->nid, ip_address());
+        db_query("DELETE FROM {poll_vote} WHERE nid = %d and hostname = '%s'", $node->nid, ip_address());
       }
 
       // Subtract from the votes.
-      db_query("UPDATE {poll_choices} SET chvotes = chvotes - 1 WHERE nid = %d AND chorder = %d", $node->nid, $node->vote);
+      db_query("UPDATE {poll_choice} SET chvotes = chvotes - 1 WHERE nid = %d AND chorder = %d", $node->nid, $node->vote);
       $node->allowvotes = TRUE;
       $node->choice[$node->vote]['chvotes']--;
       drupal_set_message(t('Your vote was canceled.'));
@@ -639,8 +639,8 @@ function poll_view($node, $teaser = FALS
 function poll_update($node) {
   db_query('UPDATE {poll} SET runtime = %d, active = %d WHERE nid = %d', $node->runtime, $node->active, $node->nid);
 
-  db_query('DELETE FROM {poll_choices} WHERE nid = %d', $node->nid);
-  db_query('DELETE FROM {poll_votes} WHERE nid = %d', $node->nid);
+  db_query('DELETE FROM {poll_choice} WHERE nid = %d', $node->nid);
+  db_query('DELETE FROM {poll_vote} WHERE nid = %d', $node->nid);
 
   $i = 0;
   foreach ($node->choice as $choice) {
@@ -648,7 +648,7 @@ function poll_update($node) {
     $chtext = $choice['chtext'];
 
     if ($chtext != '') {
-      db_query("INSERT INTO {poll_choices} (nid, chtext, chvotes, chorder) VALUES (%d, '%s', %d, %d)", $node->nid, $chtext, $chvotes, $i++);
+      db_query("INSERT INTO {poll_choice} (nid, chtext, chvotes, chorder) VALUES (%d, '%s', %d, %d)", $node->nid, $chtext, $chvotes, $i++);
     }
   }
 }
@@ -658,6 +658,6 @@ function poll_update($node) {
  */
 function poll_user($op, &$edit, &$user) {
   if ($op == 'delete') {
-    db_query('UPDATE {poll_votes} SET uid = 0 WHERE uid = %d', $user->uid);
+    db_query('UPDATE {poll_vote} SET uid = 0 WHERE uid = %d', $user->uid);
   }
 }
Index: modules/poll/poll.schema
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.schema,v
retrieving revision 1.1
diff -u -p -r1.1 poll.schema
--- modules/poll/poll.schema	25 May 2007 12:46:45 -0000	1.1
+++ modules/poll/poll.schema	26 May 2007 16:05:56 -0000
@@ -11,7 +11,7 @@ function poll_schema() {
     'primary key' => array('nid'),
   );
 
-  $schema['poll_choices'] = array(
+  $schema['poll_choice'] = array(
     'fields' => array(
       'chid'    => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
       'nid'     => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
@@ -23,7 +23,7 @@ function poll_schema() {
     'primary key' => array('chid'),
   );
 
-  $schema['poll_votes'] = array(
+  $schema['poll_vote'] = array(
     'fields' => array(
       'nid'      => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
       'uid'      => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
Index: modules/profile/profile.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.module,v
retrieving revision 1.201
diff -u -p -r1.201 profile.module
--- modules/profile/profile.module	14 May 2007 13:43:36 -0000	1.201
+++ modules/profile/profile.module	26 May 2007 16:05:57 -0000
@@ -124,7 +124,7 @@ function profile_block($op = 'list', $de
   else if ($op == 'configure' && $delta == 0) {
     // Compile a list of fields to show
     $fields = array();
-    $result = db_query('SELECT name, title, weight, visibility FROM {profile_fields} WHERE visibility IN (%d, %d) ORDER BY weight', PROFILE_PUBLIC, PROFILE_PUBLIC_LISTINGS);
+    $result = db_query('SELECT name, title, weight, visibility FROM {profile_field} WHERE visibility IN (%d, %d) ORDER BY weight', PROFILE_PUBLIC, PROFILE_PUBLIC_LISTINGS);
     while ($record = db_fetch_object($result)) {
       $fields[$record->name] = $record->title;
     }
@@ -150,7 +150,7 @@ function profile_block($op = 'list', $de
         if ($use_fields = variable_get('profile_block_author_fields', array())) {
           // Compile a list of fields to show.
           $fields = array();
-          $result = db_query('SELECT name, title, type, visibility, weight FROM {profile_fields} WHERE visibility IN (%d, %d) ORDER BY weight', PROFILE_PUBLIC, PROFILE_PUBLIC_LISTINGS);
+          $result = db_query('SELECT name, title, type, visibility, weight FROM {profile_field} WHERE visibility IN (%d, %d) ORDER BY weight', PROFILE_PUBLIC, PROFILE_PUBLIC_LISTINGS);
           while ($record = db_fetch_object($result)) {
             // Ensure that field is displayed only if it is among the defined block fields and, if it is private, the user has appropriate permissions.
             if (isset($use_fields[$record->name]) && $use_fields[$record->name]) {
@@ -200,7 +200,7 @@ function profile_user($type, &$edit, &$u
     case 'categories':
       return profile_categories();
     case 'delete':
-      db_query('DELETE FROM {profile_values} WHERE uid = %d', $user->uid);
+      db_query('DELETE FROM {profile_value} WHERE uid = %d', $user->uid);
   }
 }
 
@@ -212,7 +212,7 @@ function profile_field_form($arg = NULL)
     if (is_numeric($arg)) {
       $fid = $arg;
 
-      $edit = db_fetch_array(db_query('SELECT * FROM {profile_fields} WHERE fid = %d', $fid));
+      $edit = db_fetch_array(db_query('SELECT * FROM {profile_field} WHERE fid = %d', $fid));
 
       if (!$edit) {
         drupal_not_found();
@@ -356,10 +356,10 @@ function profile_field_form_validate($fo
     $query_suffix = ' AND fid != %d';
   }
 
-  if (db_result(db_query("SELECT fid FROM {profile_fields} WHERE title = '%s' AND category = '%s'". $query_suffix, $args1))) {
+  if (db_result(db_query("SELECT fid FROM {profile_field} WHERE title = '%s' AND category = '%s'". $query_suffix, $args1))) {
     form_set_error('title', t('The specified title is already in use.'));
   }
-  if (db_result(db_query("SELECT fid FROM {profile_fields} WHERE name = '%s'". $query_suffix, $args2))) {
+  if (db_result(db_query("SELECT fid FROM {profile_field} WHERE name = '%s'". $query_suffix, $args2))) {
     form_set_error('name', t('The specified name is already in use.'));
   }
 }
@@ -369,13 +369,13 @@ function profile_field_form_validate($fo
  */
 function profile_field_form_submit($form_values, $form, &$form_state) {
   if (!isset($form_values['fid'])) {
-    db_query("INSERT INTO {profile_fields} (title, name, explanation, category, type, weight, required, register, visibility, autocomplete, options, page) VALUES ('%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d, %d, '%s', '%s')", $form_values['title'], $form_values['name'], $form_values['explanation'], $form_values['category'], $form_values['type'], $form_values['weight'], $form_values['required'], $form_values['register'], $form_values['visibility'], $form_values['autocomplete'], $form_values['options'], $form_values['page']);
+    db_query("INSERT INTO {profile_field} (title, name, explanation, category, type, weight, required, register, visibility, autocomplete, options, page) VALUES ('%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d, %d, '%s', '%s')", $form_values['title'], $form_values['name'], $form_values['explanation'], $form_values['category'], $form_values['type'], $form_values['weight'], $form_values['required'], $form_values['register'], $form_values['visibility'], $form_values['autocomplete'], $form_values['options'], $form_values['page']);
 
     drupal_set_message(t('The field has been created.'));
     watchdog('profile', 'Profile field %field added under category %category.', array('%field' => $form_values['title'], '%category' => $form_values['category']), WATCHDOG_NOTICE, l(t('view'), 'admin/user/profile'));
   }
   else {
-    db_query("UPDATE {profile_fields} SET title = '%s', name = '%s', explanation = '%s', category = '%s', weight = %d, required = %d, register = %d, visibility = %d, autocomplete = %d, options = '%s', page = '%s' WHERE fid = %d", $form_values['title'], $form_values['name'], $form_values['explanation'], $form_values['category'], $form_values['weight'], $form_values['required'], $form_values['register'], $form_values['visibility'], $form_values['autocomplete'], $form_values['options'], $form_values['page'], $form_values['fid']);
+    db_query("UPDATE {profile_field} SET title = '%s', name = '%s', explanation = '%s', category = '%s', weight = %d, required = %d, register = %d, visibility = %d, autocomplete = %d, options = '%s', page = '%s' WHERE fid = %d", $form_values['title'], $form_values['name'], $form_values['explanation'], $form_values['category'], $form_values['weight'], $form_values['required'], $form_values['register'], $form_values['visibility'], $form_values['autocomplete'], $form_values['options'], $form_values['page'], $form_values['fid']);
 
     drupal_set_message(t('The field has been updated.'));
   }
@@ -390,7 +390,7 @@ function profile_field_form_submit($form
  * Menu callback; deletes a field from all user profiles.
  */
 function profile_field_delete($fid) {
-  $field = db_fetch_object(db_query("SELECT title FROM {profile_fields} WHERE fid = %d", $fid));
+  $field = db_fetch_object(db_query("SELECT title FROM {profile_field} WHERE fid = %d", $fid));
   if (!$field) {
     drupal_not_found();
     return;
@@ -408,8 +408,8 @@ function profile_field_delete($fid) {
  * Process a field delete form submission.
  */
 function profile_field_delete_submit($form_values, $form, &$form_state) {
-  db_query('DELETE FROM {profile_fields} WHERE fid = %d', $form_values['fid']);
-  db_query('DELETE FROM {profile_values} WHERE fid = %d', $form_values['fid']);
+  db_query('DELETE FROM {profile_field} WHERE fid = %d', $form_values['fid']);
+  db_query('DELETE FROM {profile_value} WHERE fid = %d', $form_values['fid']);
 
   cache_clear_all();
 
@@ -425,7 +425,7 @@ function profile_field_delete_submit($fo
  */
 function profile_admin_overview() {
 
-  $result = db_query('SELECT * FROM {profile_fields} ORDER BY category, weight');
+  $result = db_query('SELECT * FROM {profile_field} ORDER BY category, weight');
   $rows = array();
   while ($field = db_fetch_object($result)) {
     $rows[] = array(check_plain($field->title), $field->name, _profile_field_types($field->type), $field->category, l(t('edit'), "admin/user/profile/edit/$field->fid"), l(t('delete'), "admin/user/profile/delete/$field->fid"));
@@ -454,7 +454,7 @@ function profile_browse() {
   $name = arg(1);
   list(, , $value) = explode('/', $_GET['q'], 3);
 
-  $field = db_fetch_object(db_query("SELECT DISTINCT(fid), type, title, page, visibility FROM {profile_fields} WHERE name = '%s'", $name));
+  $field = db_fetch_object(db_query("SELECT DISTINCT(fid), type, title, page, visibility FROM {profile_field} WHERE name = '%s'", $name));
 
   if ($name && $field->fid) {
     // Only allow browsing of fields that have a page title set.
@@ -470,7 +470,7 @@ function profile_browse() {
 
     // Compile a list of fields to show.
     $fields = array();
-    $result = db_query('SELECT name, title, type, weight, page FROM {profile_fields} WHERE fid != %d AND visibility = %d ORDER BY weight', $field->fid, PROFILE_PUBLIC_LISTINGS);
+    $result = db_query('SELECT name, title, type, weight, page FROM {profile_field} WHERE fid != %d AND visibility = %d ORDER BY weight', $field->fid, PROFILE_PUBLIC_LISTINGS);
     while ($record = db_fetch_object($result)) {
       $fields[] = $record;
     }
@@ -496,7 +496,7 @@ function profile_browse() {
     }
 
     // Extract the affected users:
-    $result = pager_query("SELECT u.uid, u.access FROM {users} u INNER JOIN {profile_values} v ON u.uid = v.uid WHERE v.fid = %d AND $query AND u.access != 0 AND u.status != 0 ORDER BY u.access DESC", 20, 0, NULL, $arguments);
+    $result = pager_query("SELECT u.uid, u.access FROM {user} u INNER JOIN {profile_value} v ON u.uid = v.uid WHERE v.fid = %d AND $query AND u.access != 0 AND u.status != 0 ORDER BY u.access DESC", 20, 0, NULL, $arguments);
 
     $output = '<div id="profile">';
     while ($account = db_fetch_object($result)) {
@@ -523,13 +523,13 @@ function profile_browse() {
   else {
     // Compile a list of fields to show.
     $fields = array();
-    $result = db_query('SELECT name, title, type, weight, page FROM {profile_fields} WHERE visibility = %d ORDER BY category, weight', PROFILE_PUBLIC_LISTINGS);
+    $result = db_query('SELECT name, title, type, weight, page FROM {profile_field} WHERE visibility = %d ORDER BY category, weight', PROFILE_PUBLIC_LISTINGS);
     while ($record = db_fetch_object($result)) {
       $fields[] = $record;
     }
 
     // Extract the affected users:
-    $result = pager_query('SELECT uid, access FROM {users} WHERE uid > 0 AND status != 0 AND access != 0 ORDER BY access DESC', 20, 0, NULL);
+    $result = pager_query('SELECT uid, access FROM {user} WHERE uid > 0 AND status != 0 AND access != 0 ORDER BY access DESC', 20, 0, NULL);
 
     $output = '<div id="profile">';
     while ($account = db_fetch_object($result)) {
@@ -546,7 +546,7 @@ function profile_browse() {
 }
 
 function profile_load_profile(&$user) {
-  $result = db_query('SELECT f.name, f.type, v.value FROM {profile_fields} f INNER JOIN {profile_values} v ON f.fid = v.fid WHERE uid = %d', $user->uid);
+  $result = db_query('SELECT f.name, f.type, v.value FROM {profile_field} f INNER JOIN {profile_value} v ON f.fid = v.fid WHERE uid = %d', $user->uid);
   while ($field = db_fetch_object($result)) {
     if (empty($user->{$field->name})) {
       $user->{$field->name} = _profile_field_serialize($field->type) ? unserialize($field->value) : $field->value;
@@ -560,8 +560,8 @@ function profile_save_profile(&$edit, &$
     if (_profile_field_serialize($field->type)) {
        $edit[$field->name] = serialize($edit[$field->name]);
     }
-    db_query("DELETE FROM {profile_values} WHERE fid = %d AND uid = %d", $field->fid, $user->uid);
-    db_query("INSERT INTO {profile_values} (fid, uid, value) VALUES (%d, %d, '%s')", $field->fid, $user->uid, $edit[$field->name]);
+    db_query("DELETE FROM {profile_value} WHERE fid = %d AND uid = %d", $field->fid, $user->uid);
+    db_query("INSERT INTO {profile_value} (fid, uid, value) VALUES (%d, %d, '%s')", $field->fid, $user->uid, $edit[$field->name]);
     // Mark field as handled (prevents saving to user->data).
     $edit[$field->name] = NULL;
   }
@@ -618,10 +618,10 @@ function profile_view_profile($user) {
 
   // Show private fields to administrators and people viewing their own account.
   if (user_access('administer users') || $GLOBALS['user']->uid == $user->uid) {
-    $result = db_query('SELECT * FROM {profile_fields} WHERE visibility != %d ORDER BY category, weight', PROFILE_HIDDEN);
+    $result = db_query('SELECT * FROM {profile_field} WHERE visibility != %d ORDER BY category, weight', PROFILE_HIDDEN);
   }
   else {
-    $result = db_query('SELECT * FROM {profile_fields} WHERE visibility != %d AND visibility != %d ORDER BY category, weight', PROFILE_PRIVATE, PROFILE_HIDDEN);
+    $result = db_query('SELECT * FROM {profile_field} WHERE visibility != %d AND visibility != %d ORDER BY category, weight', PROFILE_PRIVATE, PROFILE_HIDDEN);
   }
 
   $fields = array();
@@ -732,9 +732,9 @@ function profile_form_profile($edit, $us
  * Callback to allow autocomplete of profile text fields.
  */
 function profile_autocomplete($field, $string) {
-  if (db_result(db_query("SELECT COUNT(*) FROM {profile_fields} WHERE fid = %d AND autocomplete = 1", $field))) {
+  if (db_result(db_query("SELECT COUNT(*) FROM {profile_field} WHERE fid = %d AND autocomplete = 1", $field))) {
     $matches = array();
-    $result = db_query_range("SELECT value FROM {profile_values} WHERE fid = %d AND LOWER(value) LIKE LOWER('%s%%') GROUP BY value ORDER BY value ASC", $field, $string, 0, 10);
+    $result = db_query_range("SELECT value FROM {profile_value} WHERE fid = %d AND LOWER(value) LIKE LOWER('%s%%') GROUP BY value ORDER BY value ASC", $field, $string, 0, 10);
     while ($data = db_fetch_object($result)) {
       $matches[$data->value] = check_plain($data->value);
     }
@@ -773,7 +773,7 @@ function profile_validate_profile($edit,
 }
 
 function profile_categories() {
-  $result = db_query("SELECT DISTINCT(category) FROM {profile_fields}");
+  $result = db_query("SELECT DISTINCT(category) FROM {profile_field}");
   $data = array();
   while ($category = db_fetch_object($result)) {
     $data[] = array('name' => $category->category, 'title' => $category->category, 'weight' => 3);
@@ -833,7 +833,7 @@ function _profile_field_serialize($type 
 
 function _profile_get_fields($category, $register = FALSE) {
   $args = array();
-  $sql = 'SELECT * FROM {profile_fields} WHERE ';
+  $sql = 'SELECT * FROM {profile_field} WHERE ';
   $filters = array();
   if ($register) {
     $filters[] = 'register = 1';
@@ -857,7 +857,7 @@ function _profile_get_fields($category, 
  */
 function profile_admin_settings_autocomplete($string) {
   $matches = array();
-  $result = db_query_range("SELECT category FROM {profile_fields} WHERE LOWER(category) LIKE LOWER('%s%%')", $string, 0, 10);
+  $result = db_query_range("SELECT category FROM {profile_field} WHERE LOWER(category) LIKE LOWER('%s%%')", $string, 0, 10);
   while ($data = db_fetch_object($result)) {
     $matches[$data->category] = check_plain($data->category);
   }
Index: modules/profile/profile.schema
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.schema,v
retrieving revision 1.1
diff -u -p -r1.1 profile.schema
--- modules/profile/profile.schema	25 May 2007 12:46:45 -0000	1.1
+++ modules/profile/profile.schema	26 May 2007 16:05:57 -0000
@@ -2,7 +2,7 @@
 // $Id: profile.schema,v 1.1 2007/05/25 12:46:45 dries Exp $
 
 function profile_schema() {
-  $schema['profile_fields'] = array(
+  $schema['profile_field'] = array(
     'fields' => array(
       'fid'          => array('type' => 'serial', 'not null' => TRUE),
       'title'        => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE),
@@ -23,7 +23,7 @@ function profile_schema() {
     'primary key' => array('fid'),
   );
 
-  $schema['profile_values'] = array(
+  $schema['profile_value'] = array(
     'fields' => array(
       'fid'   => array('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'default' => 0),
       'uid'   => array('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'default' => 0),
Index: modules/search/search.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.module,v
retrieving revision 1.222
diff -u -p -r1.222 search.module
--- modules/search/search.module	15 May 2007 05:43:16 -0000	1.222
+++ modules/search/search.module	26 May 2007 16:05:58 -0000
@@ -556,7 +556,7 @@ function search_index($sid, $type, $text
               $linknid = $match[1];
               if ($linknid > 0) {
                 // Note: ignore links to uncachable nodes to avoid redirect bugs.
-                $node = db_fetch_object(db_query('SELECT n.title, n.nid, n.vid, r.format FROM {node} n INNER JOIN {node_revisions} r ON n.vid = r.vid WHERE n.nid = %d', $linknid));
+                $node = db_fetch_object(db_query('SELECT n.title, n.nid, n.vid, r.format FROM {node} n INNER JOIN {node_revision} r ON n.vid = r.vid WHERE n.nid = %d', $linknid));
                 if (filter_format_allowcache($node->format)) {
                   $link = TRUE;
                   $linktitle = $node->title;
@@ -848,7 +848,7 @@ function _search_parse_query(&$word, &$s
  *
  * @param $join2
  *   (optional) Inserted into the JOIN par of the second SQL query.
- *   For example "INNER JOIN {node_comment_statistics} n ON n.nid = i.sid"
+ *   For example "INNER JOIN {node_comment_statistic} n ON n.nid = i.sid"
  *
  * @param $arguments2
  *   (optional) Extra SQL arguments belonging to the second query parameter.
Index: modules/statistics/statistics.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/statistics/statistics.module,v
retrieving revision 1.259
diff -u -p -r1.259 statistics.module
--- modules/statistics/statistics.module	25 May 2007 15:04:42 -0000	1.259
+++ modules/statistics/statistics.module	26 May 2007 16:05:59 -0000
@@ -173,7 +173,7 @@ function statistics_user($op, &$edit, &$
 }
 
 function statistics_access_log($aid) {
-  $result = db_query('SELECT a.*, u.name FROM {accesslog} a LEFT JOIN {users} u ON a.uid = u.uid WHERE aid = %d', $aid);
+  $result = db_query('SELECT a.*, u.name FROM {accesslog} a LEFT JOIN {user} u ON a.uid = u.uid WHERE aid = %d', $aid);
   if ($access = db_fetch_object($result)) {
     $output  = '<table border="1" cellpadding="2" cellspacing="2">';
     $output .= ' <tr><th>'. t('URL') ."</th><td>". l(url($access->path, array('absolute' => TRUE)), $access->path) ."</td></tr>";
@@ -199,7 +199,7 @@ function statistics_node_tracker() {
         array('data' => t('User'), 'field' => 'u.name'),
         array('data' => t('Operations')));
 
-    $result = pager_query('SELECT a.aid, a.timestamp, a.url, a.uid, u.name FROM {accesslog} a LEFT JOIN {users} u ON a.uid = u.uid WHERE a.path LIKE \'node/%d%%\''. tablesort_sql($header), 30, 0, NULL, $node->nid);
+    $result = pager_query('SELECT a.aid, a.timestamp, a.url, a.uid, u.name FROM {accesslog} a LEFT JOIN {user} u ON a.uid = u.uid WHERE a.path LIKE \'node/%d%%\''. tablesort_sql($header), 30, 0, NULL, $node->nid);
     $rows = array();
     while ($log = db_fetch_object($result)) {
       $rows[] = array(
@@ -265,7 +265,7 @@ function statistics_recent_hits() {
     array('data' => t('Operations'))
   );
 
-  $sql = 'SELECT a.aid, a.path, a.title, a.uid, u.name, a.timestamp FROM {accesslog} a LEFT JOIN {users} u ON u.uid = a.uid'. tablesort_sql($header);
+  $sql = 'SELECT a.aid, a.path, a.title, a.uid, u.name, a.timestamp FROM {accesslog} a LEFT JOIN {user} u ON u.uid = a.uid'. tablesort_sql($header);
 
   $result = pager_query($sql, 30);
   $rows = array();
@@ -329,7 +329,7 @@ function statistics_top_visitors() {
     array('data' => t('Operations'))
   );
 
-  $sql = "SELECT COUNT(a.uid) AS hits, a.uid, u.name, a.hostname, SUM(a.timer) AS total, ac.aid FROM {accesslog} a LEFT JOIN {access} ac ON ac.type = 'host' AND LOWER(a.hostname) LIKE (ac.mask) LEFT JOIN {users} u ON a.uid = u.uid GROUP BY a.hostname, a.uid, u.name, ac.aid". tablesort_sql($header);
+  $sql = "SELECT COUNT(a.uid) AS hits, a.uid, u.name, a.hostname, SUM(a.timer) AS total, ac.aid FROM {accesslog} a LEFT JOIN {access} ac ON ac.type = 'host' AND LOWER(a.hostname) LIKE (ac.mask) LEFT JOIN {user} u ON a.uid = u.uid GROUP BY a.hostname, a.uid, u.name, ac.aid". tablesort_sql($header);
   $sql_cnt = "SELECT COUNT(DISTINCT(CONCAT(uid, hostname))) FROM {accesslog}";
   $result = pager_query($sql, 30, 0, $sql_cnt);
 
@@ -448,7 +448,7 @@ function statistics_cron() {
  *   or FALSE if the query could not be executed correctly.
  */
 function statistics_title_list($dbfield, $dbrows) {
-  return db_query_range(db_rewrite_sql("SELECT n.nid, n.title, u.uid, u.name FROM {node} n INNER JOIN {node_counter} s ON n.nid = s.nid INNER JOIN {users} u ON n.uid = u.uid WHERE %s <> '0' AND n.status = 1 ORDER BY %s DESC"), 's.'. $dbfield, 's.'. $dbfield, 0, $dbrows);
+  return db_query_range(db_rewrite_sql("SELECT n.nid, n.title, u.uid, u.name FROM {node} n INNER JOIN {node_counter} s ON n.nid = s.nid INNER JOIN {user} u ON n.uid = u.uid WHERE %s <> '0' AND n.status = 1 ORDER BY %s DESC"), 's.'. $dbfield, 's.'. $dbfield, 0, $dbrows);
 }
 
 
Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.1
diff -u -p -r1.1 system.admin.inc
--- modules/system/system.admin.inc	22 May 2007 05:52:17 -0000	1.1
+++ modules/system/system.admin.inc	26 May 2007 16:05:59 -0000
@@ -15,7 +15,7 @@ function system_main_admin_page($arg = N
   if (system_status(TRUE)) {
     drupal_set_message(t('One or more problems were detected with your Drupal installation. Check the <a href="@status">status report</a> for more information.', array('@status' => url('admin/logs/status'))), 'error');
   }
-  $result = db_query("SELECT * FROM {menu_links} ml INNER JOIN {menu_router} m ON ml.router_path = m.path
+  $result = db_query("SELECT * FROM {menu_link} ml INNER JOIN {menu_router} m ON ml.router_path = m.path
                       WHERE ml.href like 'admin/%' AND ml.href != 'admin/help' AND ml.depth = 2 AND ml.menu_name = 'navigation'
                       ORDER BY p1 ASC, p2 ASC, p3 ASC");
   while ($item = db_fetch_object($result)) {
Index: modules/system/system.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.install,v
retrieving revision 1.117
diff -u -p -r1.117 system.install
--- modules/system/system.install	25 May 2007 12:46:45 -0000	1.117
+++ modules/system/system.install	26 May 2007 16:06:01 -0000
@@ -170,6 +170,7 @@ function system_requirements($phase) {
  * Implementation of hook_install().
  */
 function system_install() {
+
  switch ($GLOBALS['db_type']) {
   case 'mysql':
   case 'mysqli':
@@ -235,7 +236,7 @@ function system_install() {
   // Load system theme data appropriately.
   system_theme_data();
 
-  db_query("INSERT INTO {users} (uid,name,mail) VALUES(0,'','')");
+  db_query("INSERT INTO {user} (uid,name,mail) VALUES(0,'','')");
 
   db_query("INSERT INTO {role} (name) VALUES ('anonymous user')");
   db_query("INSERT INTO {role} (name) VALUES ('authenticated user')");
@@ -245,34 +246,34 @@ function system_install() {
 
   db_query("INSERT INTO {variable} (name,value) VALUES('theme_default', 's:7:\"garland\";')");
 
-  db_query("INSERT INTO {blocks} (module,delta,theme,status,pages) VALUES('user', 0, 'garland', 1, '')");
-  db_query("INSERT INTO {blocks} (module,delta,theme,status,pages) VALUES('user', 1, 'garland', 1, '')");
+  db_query("INSERT INTO {block} (module,delta,theme,status,pages) VALUES('user', 0, 'garland', 1, '')");
+  db_query("INSERT INTO {block} (module,delta,theme,status,pages) VALUES('user', 1, 'garland', 1, '')");
 
   db_query("INSERT INTO {node_access} VALUES (0, 0, 'all', 1, 0, 0)");
 
   // Add input formats.
-  db_query("INSERT INTO {filter_formats} (name, roles, cache) VALUES ('Filtered HTML', ',1,2,', 1)");
-  db_query("INSERT INTO {filter_formats} (name, roles, cache) VALUES ('Full HTML', '', 1)");
+  db_query("INSERT INTO {filter_format} (name, roles, cache) VALUES ('Filtered HTML', ',1,2,', 1)");
+  db_query("INSERT INTO {filter_format} (name, roles, cache) VALUES ('Full HTML', '', 1)");
 
   // Enable filters for each input format.
 
   // Filtered HTML:
   // URL filter.
-  db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (1, 'filter', 2, 0)");
+  db_query("INSERT INTO {filter} (format, module, delta, weight) VALUES (1, 'filter', 2, 0)");
   // HTML filter.
-  db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (1, 'filter', 0, 1)");
+  db_query("INSERT INTO {filter} (format, module, delta, weight) VALUES (1, 'filter', 0, 1)");
   // Line break filter.
-  db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (1, 'filter', 1, 2)");
+  db_query("INSERT INTO {filter} (format, module, delta, weight) VALUES (1, 'filter', 1, 2)");
   // HTML corrector filter.
-  db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (1, 'filter', 3, 10)");
+  db_query("INSERT INTO {filter} (format, module, delta, weight) VALUES (1, 'filter', 3, 10)");
 
   // Full HTML:
   // URL filter.
-  db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (2, 'filter', 2, 0)");
+  db_query("INSERT INTO {filter} (format, module, delta, weight) VALUES (2, 'filter', 2, 0)");
   // Line break filter.
-  db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (2, 'filter', 1, 1)");
+  db_query("INSERT INTO {filter} (format, module, delta, weight) VALUES (2, 'filter', 1, 1)");
   // HTML corrector filter.
-  db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (1, 'filter', 3, 10)");
+  db_query("INSERT INTO {filter} (format, module, delta, weight) VALUES (1, 'filter', 3, 10)");
 
   db_query("INSERT INTO {variable} (name,value) VALUES ('filter_html_1','i:1;')");
 
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.482
diff -u -p -r1.482 system.module
--- modules/system/system.module	25 May 2007 15:04:42 -0000	1.482
+++ modules/system/system.module	26 May 2007 16:06:03 -0000
@@ -393,9 +393,9 @@ function system_user($type, $edit, &$use
 function system_admin_menu_block($item) {
   $content = array();
   if (!isset($item->mlid)) {
-    $item->mlid = db_result(db_query("SELECT mlid FROM {menu_links} ml WHERE ml.router_path = '%s' AND menu_name = 'navigation'", $item->path));
+    $item->mlid = db_result(db_query("SELECT mlid FROM {menu_link} ml WHERE ml.router_path = '%s' AND menu_name = 'navigation'", $item->path));
   }
-  $result = db_query("SELECT * FROM {menu_links} ml INNER JOIN {menu_router} m ON ml.router_path = m.path
+  $result = db_query("SELECT * FROM {menu_link} ml INNER JOIN {menu_router} m ON ml.router_path = m.path
                       WHERE ml.plid = '%s' AND ml.menu_name = 'navigation' ORDER BY m.weight, m.title", $item->mlid);
   while ($item = db_fetch_object($result)) {
     _menu_link_translate($item);
@@ -440,7 +440,7 @@ function system_admin_theme_settings() {
 function system_admin_theme_submit($form_values, $form, &$form_state) {
   // If we're changing themes, make sure the theme has its blocks initialized.
   if ($form_values['admin_theme'] != variable_get('admin_theme', '0')) {
-    $result = db_query("SELECT status FROM {blocks} WHERE theme = '%s'", $form_values['admin_theme']);
+    $result = db_query("SELECT status FROM {block} WHERE theme = '%s'", $form_values['admin_theme']);
     if (!db_num_rows($result)) {
       system_initialize_theme_blocks($form_values['admin_theme']);
     }
@@ -1202,16 +1202,16 @@ function system_default_region($theme) {
  */
 function system_initialize_theme_blocks($theme) {
   // Initialize theme's blocks if none already registered.
-  if (!(db_num_rows(db_query("SELECT module FROM {blocks} WHERE theme = '%s'", $theme)))) {
+  if (!(db_num_rows(db_query("SELECT module FROM {block} WHERE theme = '%s'", $theme)))) {
     $default_theme = variable_get('theme_default', 'garland');
     $regions = system_region_list($theme);
-    $result = db_query("SELECT * FROM {blocks} WHERE theme = '%s'", $default_theme);
+    $result = db_query("SELECT * FROM {block} WHERE theme = '%s'", $default_theme);
     while ($block = db_fetch_array($result)) {
       // If the region isn't supported by the theme, assign the block to the theme's default region.
       if (!array_key_exists($block['region'], $regions)) {
         $block['region'] = system_default_region($theme);
       }
-      db_query("INSERT INTO {blocks} (module, delta, theme, status, weight, region, visibility, pages, custom, throttle) VALUES ('%s', '%s', '%s', %d, %d, '%s', %d, '%s', %d, %d)",
+      db_query("INSERT INTO {block} (module, delta, theme, status, weight, region, visibility, pages, custom, throttle) VALUES ('%s', '%s', '%s', %d, %d, '%s', %d, '%s', %d, %d)",
           $block['module'], $block['delta'], $theme, $block['status'], $block['weight'], $block['region'], $block['visibility'], $block['pages'], $block['custom'], $block['throttle']);
     }
   }
Index: modules/system/system.schema
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.schema,v
retrieving revision 1.2
diff -u -p -r1.2 system.schema
--- modules/system/system.schema	25 May 2007 15:47:57 -0000	1.2
+++ modules/system/system.schema	26 May 2007 16:06:04 -0000
@@ -29,7 +29,7 @@ function system_schema() {
   $schema['cache_form'] = $schema['cache'];
   $schema['cache_page'] = $schema['cache'];
 
-  $schema['files'] = array(
+  $schema['file'] = array(
     'fields' => array(
       'fid'      => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
       'nid'      => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
@@ -42,7 +42,7 @@ function system_schema() {
     'primary key' => array('fid'),
   );
 
-  $schema['file_revisions'] = array(
+  $schema['file_revision'] = array(
     'fields' => array(
       'fid'         => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
       'vid'         => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
@@ -72,7 +72,7 @@ function system_schema() {
     'primary key' => array('uid', 'nid'),
   );
 
-  $schema['sequences'] = array(
+  $schema['sequence'] = array(
     'fields' => array(
       'name' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
       'id'   => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0)
@@ -80,7 +80,7 @@ function system_schema() {
     'primary key' => array('name'),
   );
 
-  $schema['sessions'] = array(
+  $schema['session'] = array(
     'fields' => array(
       'uid'       => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
       'sid'       => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''),
Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.355
diff -u -p -r1.355 taxonomy.module
--- modules/taxonomy/taxonomy.module	14 May 2007 13:43:37 -0000	1.355
+++ modules/taxonomy/taxonomy.module	26 May 2007 16:06:05 -0000
@@ -328,9 +328,9 @@ function taxonomy_save_vocabulary(&$edit
 
   if (!empty($edit['vid']) && !empty($edit['name'])) {
     db_query("UPDATE {vocabulary} SET name = '%s', description = '%s', help = '%s', multiple = %d, required = %d, hierarchy = %d, relations = %d, tags = %d, weight = %d, module = '%s' WHERE vid = %d", $edit['name'], $edit['description'], $edit['help'], $edit['multiple'], $edit['required'], $edit['hierarchy'], $edit['relations'], $edit['tags'], $edit['weight'], isset($edit['module']) ? $edit['module'] : 'taxonomy', $edit['vid']);
-    db_query("DELETE FROM {vocabulary_node_types} WHERE vid = %d", $edit['vid']);
+    db_query("DELETE FROM {vocabulary_node_type} WHERE vid = %d", $edit['vid']);
     foreach ($edit['nodes'] as $type => $selected) {
-      db_query("INSERT INTO {vocabulary_node_types} (vid, type) VALUES (%d, '%s')", $edit['vid'], $type);
+      db_query("INSERT INTO {vocabulary_node_type} (vid, type) VALUES (%d, '%s')", $edit['vid'], $type);
     }
     module_invoke_all('taxonomy', 'update', 'vocabulary', $edit);
     $status = SAVED_UPDATED;
@@ -342,7 +342,7 @@ function taxonomy_save_vocabulary(&$edit
     $edit['vid'] = db_next_id('{vocabulary}_vid');
     db_query("INSERT INTO {vocabulary} (vid, name, description, help, multiple, required, hierarchy, relations, tags, weight, module) VALUES (%d, '%s', '%s', '%s', %d, %d, %d, %d, %d, %d, '%s')", $edit['vid'], $edit['name'], isset($edit['description']) ? $edit['description'] : NULL, isset($edit['help']) ? $edit['help'] : NULL, $edit['multiple'], $edit['required'], $edit['hierarchy'], $edit['relations'], isset($edit['tags']) ? $edit['tags'] : NULL, $edit['weight'], isset($edit['module']) ? $edit['module'] : 'taxonomy');
     foreach ($edit['nodes'] as $type => $selected) {
-      db_query("INSERT INTO {vocabulary_node_types} (vid, type) VALUES (%d, '%s')", $edit['vid'], $type);
+      db_query("INSERT INTO {vocabulary_node_type} (vid, type) VALUES (%d, '%s')", $edit['vid'], $type);
     }
     module_invoke_all('taxonomy', 'insert', 'vocabulary', $edit);
     $status = SAVED_NEW;
@@ -365,8 +365,8 @@ function taxonomy_del_vocabulary($vid) {
   $vocabulary = (array) taxonomy_vocabulary_load($vid);
 
   db_query('DELETE FROM {vocabulary} WHERE vid = %d', $vid);
-  db_query('DELETE FROM {vocabulary_node_types} WHERE vid = %d', $vid);
-  $result = db_query('SELECT tid FROM {term_data} WHERE vid = %d', $vid);
+  db_query('DELETE FROM {vocabulary_node_type} WHERE vid = %d', $vid);
+  $result = db_query('SELECT tid FROM {term} WHERE vid = %d', $vid);
   while ($term = db_fetch_object($result)) {
     taxonomy_del_term($term->tid);
   }
@@ -510,7 +510,7 @@ function taxonomy_save_term(&$form_value
   );
 
   if (!empty($form_values['tid']) && $form_values['name']) {
-    db_query("UPDATE {term_data} SET name = '%s', description = '%s', weight = %d WHERE tid = %d", $form_values['name'], $form_values['description'], $form_values['weight'], $form_values['tid']);
+    db_query("UPDATE {term} SET name = '%s', description = '%s', weight = %d WHERE tid = %d", $form_values['name'], $form_values['description'], $form_values['weight'], $form_values['tid']);
     $hook = 'update';
     $status = SAVED_UPDATED;
   }
@@ -518,8 +518,8 @@ function taxonomy_save_term(&$form_value
     return taxonomy_del_term($form_values['tid']);
   }
   else {
-    $form_values['tid'] = db_next_id('{term_data}_tid');
-    db_query("INSERT INTO {term_data} (tid, name, description, vid, weight) VALUES (%d, '%s', '%s', %d, %d)", $form_values['tid'], $form_values['name'], $form_values['description'], $form_values['vid'], $form_values['weight']);
+    $form_values['tid'] = db_next_id('{term}_tid');
+    db_query("INSERT INTO {term} (tid, name, description, vid, weight) VALUES (%d, '%s', '%s', %d, %d)", $form_values['tid'], $form_values['name'], $form_values['description'], $form_values['vid'], $form_values['weight']);
     $hook = 'insert';
     $status = SAVED_NEW;
   }
@@ -597,7 +597,7 @@ function taxonomy_del_term($tid) {
 
       $term = (array) taxonomy_get_term($tid);
 
-      db_query('DELETE FROM {term_data} WHERE tid = %d', $tid);
+      db_query('DELETE FROM {term} WHERE tid = %d', $tid);
       db_query('DELETE FROM {term_hierarchy} WHERE tid = %d', $tid);
       db_query('DELETE FROM {term_relation} WHERE tid1 = %d OR tid2 = %d', $tid, $tid);
       db_query('DELETE FROM {term_synonym} WHERE tid = %d', $tid);
@@ -680,10 +680,10 @@ function taxonomy_form_all($free_tags = 
  */
 function taxonomy_get_vocabularies($type = NULL) {
   if ($type) {
-    $result = db_query(db_rewrite_sql("SELECT v.vid, v.*, n.type FROM {vocabulary} v LEFT JOIN {vocabulary_node_types} n ON v.vid = n.vid WHERE n.type = '%s' ORDER BY v.weight, v.name", 'v', 'vid'), $type);
+    $result = db_query(db_rewrite_sql("SELECT v.vid, v.*, n.type FROM {vocabulary} v LEFT JOIN {vocabulary_node_type} n ON v.vid = n.vid WHERE n.type = '%s' ORDER BY v.weight, v.name", 'v', 'vid'), $type);
   }
   else {
-    $result = db_query(db_rewrite_sql('SELECT v.*, n.type FROM {vocabulary} v LEFT JOIN {vocabulary_node_types} n ON v.vid = n.vid ORDER BY v.weight, v.name', 'v', 'vid'));
+    $result = db_query(db_rewrite_sql('SELECT v.*, n.type FROM {vocabulary} v LEFT JOIN {vocabulary_node_type} n ON v.vid = n.vid ORDER BY v.weight, v.name', 'v', 'vid'));
   }
 
   $vocabularies = array();
@@ -713,7 +713,7 @@ function taxonomy_form_alter(&$form, $fo
       $terms = $node->taxonomy;
     }
 
-    $c = db_query(db_rewrite_sql("SELECT v.* FROM {vocabulary} v INNER JOIN {vocabulary_node_types} n ON v.vid = n.vid WHERE n.type = '%s' ORDER BY v.weight, v.name", 'v', 'vid'), $node->type);
+    $c = db_query(db_rewrite_sql("SELECT v.* FROM {vocabulary} v INNER JOIN {vocabulary_node_type} n ON v.vid = n.vid WHERE n.type = '%s' ORDER BY v.weight, v.name", 'v', 'vid'), $node->type);
 
     while ($vocabulary = db_fetch_object($c)) {
       if ($vocabulary->tags) {
@@ -767,7 +767,7 @@ function taxonomy_form_alter(&$form, $fo
  * Find all terms associated with the given node, within one vocabulary.
  */
 function taxonomy_node_get_terms_by_vocabulary($node, $vid, $key = 'tid') {
-  $result = db_query(db_rewrite_sql('SELECT t.tid, t.* FROM {term_data} t INNER JOIN {term_node} r ON r.tid = t.tid WHERE t.vid = %d AND r.vid = %d ORDER BY weight', 't', 'tid'), $vid, $node->vid);
+  $result = db_query(db_rewrite_sql('SELECT t.tid, t.* FROM {term} t INNER JOIN {term_node} r ON r.tid = t.tid WHERE t.vid = %d AND r.vid = %d ORDER BY weight', 't', 'tid'), $vid, $node->vid);
   $terms = array();
   while ($term = db_fetch_object($result)) {
     $terms[$term->$key] = $term;
@@ -782,7 +782,7 @@ function taxonomy_node_get_terms($node, 
   static $terms;
 
   if (!isset($terms[$node->vid][$key])) {
-    $result = db_query(db_rewrite_sql('SELECT t.* FROM {term_node} r INNER JOIN {term_data} t ON r.tid = t.tid INNER JOIN {vocabulary} v ON t.vid = v.vid WHERE r.vid = %d ORDER BY v.weight, t.weight, t.name', 't', 'tid'), $node->vid);
+    $result = db_query(db_rewrite_sql('SELECT t.* FROM {term_node} r INNER JOIN {term} t ON r.tid = t.tid INNER JOIN {vocabulary} v ON t.vid = v.vid WHERE r.vid = %d ORDER BY v.weight, t.weight, t.name', 't', 'tid'), $node->vid);
     $terms[$node->vid][$key] = array();
     while ($term = db_fetch_object($result)) {
       $terms[$node->vid][$key][$term->$key] = $term;
@@ -891,10 +891,10 @@ function taxonomy_node_delete_revision($
  */
 function taxonomy_node_type($op, $info) {
   if ($op == 'update' && !empty($info->old_type) && $info->type != $info->old_type) {
-    db_query("UPDATE {vocabulary_node_types} SET type = '%s' WHERE type = '%s'", $info->type, $info->old_type);
+    db_query("UPDATE {vocabulary_node_type} SET type = '%s' WHERE type = '%s'", $info->type, $info->old_type);
   }
   elseif ($op == 'delete') {
-    db_query("DELETE FROM {vocabulary_node_types} WHERE type = '%s'", $info->type);
+    db_query("DELETE FROM {vocabulary_node_type} WHERE type = '%s'", $info->type);
   }
 }
 
@@ -903,7 +903,7 @@ function taxonomy_node_type($op, $info) 
  */
 function taxonomy_get_related($tid, $key = 'tid') {
   if ($tid) {
-    $result = db_query('SELECT t.*, tid1, tid2 FROM {term_relation}, {term_data} t WHERE (t.tid = tid1 OR t.tid = tid2) AND (tid1 = %d OR tid2 = %d) AND t.tid != %d ORDER BY weight, name', $tid, $tid, $tid);
+    $result = db_query('SELECT t.*, tid1, tid2 FROM {term_relation}, {term} t WHERE (t.tid = tid1 OR t.tid = tid2) AND (tid1 = %d OR tid2 = %d) AND t.tid != %d ORDER BY weight, name', $tid, $tid, $tid);
     $related = array();
     while ($term = db_fetch_object($result)) {
       $related[$term->$key] = $term;
@@ -920,7 +920,7 @@ function taxonomy_get_related($tid, $key
  */
 function taxonomy_get_parents($tid, $key = 'tid') {
   if ($tid) {
-    $result = db_query(db_rewrite_sql('SELECT t.tid, t.* FROM {term_data} t INNER JOIN {term_hierarchy} h ON h.parent = t.tid WHERE h.tid = %d ORDER BY weight, name', 't', 'tid'), $tid);
+    $result = db_query(db_rewrite_sql('SELECT t.tid, t.* FROM {term} t INNER JOIN {term_hierarchy} h ON h.parent = t.tid WHERE h.tid = %d ORDER BY weight, name', 't', 'tid'), $tid);
     $parents = array();
     while ($parent = db_fetch_object($result)) {
       $parents[$parent->$key] = $parent;
@@ -953,10 +953,10 @@ function taxonomy_get_parents_all($tid) 
  */
 function taxonomy_get_children($tid, $vid = 0, $key = 'tid') {
   if ($vid) {
-    $result = db_query(db_rewrite_sql('SELECT t.* FROM {term_data} t INNER JOIN {term_hierarchy} h ON h.tid = t.tid WHERE t.vid = %d AND h.parent = %d ORDER BY weight, name', 't', 'tid'), $vid, $tid);
+    $result = db_query(db_rewrite_sql('SELECT t.* FROM {term} t INNER JOIN {term_hierarchy} h ON h.tid = t.tid WHERE t.vid = %d AND h.parent = %d ORDER BY weight, name', 't', 'tid'), $vid, $tid);
   }
   else {
-    $result = db_query(db_rewrite_sql('SELECT t.* FROM {term_data} t INNER JOIN {term_hierarchy} h ON h.tid = t.tid WHERE parent = %d ORDER BY weight, name', 't', 'tid'), $tid);
+    $result = db_query(db_rewrite_sql('SELECT t.* FROM {term} t INNER JOIN {term_hierarchy} h ON h.tid = t.tid WHERE parent = %d ORDER BY weight, name', 't', 'tid'), $tid);
   }
   $children = array();
   while ($term = db_fetch_object($result)) {
@@ -996,7 +996,7 @@ function taxonomy_get_tree($vid, $parent
   if (!isset($children[$vid])) {
     $children[$vid] = array();
 
-    $result = db_query(db_rewrite_sql('SELECT t.tid, t.*, parent FROM {term_data} t INNER JOIN  {term_hierarchy} h ON t.tid = h.tid WHERE t.vid = %d ORDER BY weight, name', 't', 'tid'), $vid);
+    $result = db_query(db_rewrite_sql('SELECT t.tid, t.*, parent FROM {term} t INNER JOIN  {term_hierarchy} h ON t.tid = h.tid WHERE t.vid = %d ORDER BY weight, name', 't', 'tid'), $vid);
     while ($term = db_fetch_object($result)) {
       $children[$vid][$term->parent][] = $term->tid;
       $parents[$vid][$term->tid][] = $term->parent;
@@ -1046,7 +1046,7 @@ function taxonomy_get_synonyms($tid) {
  * Return the term object that has the given string as a synonym.
  */
 function taxonomy_get_synonym_root($synonym) {
-  return db_fetch_object(db_query("SELECT * FROM {term_synonym} s, {term_data} t WHERE t.tid = s.tid AND s.name = '%s'", $synonym));
+  return db_fetch_object(db_query("SELECT * FROM {term_synonym} s, {term} t WHERE t.tid = s.tid AND s.name = '%s'", $synonym));
 }
 
 /**
@@ -1122,7 +1122,7 @@ function _taxonomy_term_children($tid) {
  *   An array of matching term objects.
  */
 function taxonomy_get_term_by_name($name) {
-  $db_result = db_query(db_rewrite_sql("SELECT t.tid, t.* FROM {term_data} t WHERE LOWER('%s') LIKE LOWER(t.name)", 't', 'tid'), trim($name));
+  $db_result = db_query(db_rewrite_sql("SELECT t.tid, t.* FROM {term} t WHERE LOWER('%s') LIKE LOWER(t.name)", 't', 'tid'), trim($name));
   $result = array();
   while ($term = db_fetch_object($db_result)) {
     $result[] = $term;
@@ -1145,7 +1145,7 @@ function taxonomy_vocabulary_load($vid) 
   static $vocabularies = array();
 
   if (!array_key_exists($vid, $vocabularies)) {
-    $result = db_query('SELECT v.*, n.type FROM {vocabulary} v LEFT JOIN {vocabulary_node_types} n ON v.vid = n.vid WHERE v.vid = %d ORDER BY v.weight, v.name', $vid);
+    $result = db_query('SELECT v.*, n.type FROM {vocabulary} v LEFT JOIN {vocabulary_node_type} n ON v.vid = n.vid WHERE v.vid = %d ORDER BY v.weight, v.name', $vid);
     $node_types = array();
     while ($voc = db_fetch_object($result)) {
       if (!empty($voc->type)) {
@@ -1173,7 +1173,7 @@ function taxonomy_get_term($tid) {
   static $terms = array();
 
   if (!isset($terms[$tid])) {
-    $terms[$tid] = db_fetch_object(db_query('SELECT * FROM {term_data} WHERE tid = %d', $tid));
+    $terms[$tid] = db_fetch_object(db_query('SELECT * FROM {term} WHERE tid = %d', $tid));
   }
 
   return $terms[$tid];
@@ -1386,7 +1386,7 @@ function taxonomy_term_page($str_tids = 
   }
 
   if ($terms['tids']) {
-    $result = db_query(db_rewrite_sql('SELECT t.tid, t.name FROM {term_data} t WHERE t.tid IN (%s)', 't', 'tid'), implode(',', $terms['tids']));
+    $result = db_query(db_rewrite_sql('SELECT t.tid, t.name FROM {term} t WHERE t.tid IN (%s)', 't', 'tid'), implode(',', $terms['tids']));
     $tids = array(); // we rebuild the $tids-array so it only contains terms the user has access to.
     $names = array();
     while ($term = db_fetch_object($result)) {
@@ -1505,7 +1505,7 @@ function taxonomy_autocomplete($vid, $st
   // Fetch last tag
   $last_string = trim(array_pop($array));
   if ($last_string != '') {
-    $result = db_query_range(db_rewrite_sql("SELECT t.tid, t.name FROM {term_data} t WHERE t.vid = %d AND LOWER(t.name) LIKE LOWER('%%%s%%')", 't', 'tid'), $vid, $last_string, 0, 10);
+    $result = db_query_range(db_rewrite_sql("SELECT t.tid, t.name FROM {term} t WHERE t.vid = %d AND LOWER(t.name) LIKE LOWER('%%%s%%')", 't', 'tid'), $vid, $last_string, 0, 10);
 
     $prefix = count($array) ? implode(', ', $array) .', ' : '';
 
Index: modules/taxonomy/taxonomy.schema
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.schema,v
retrieving revision 1.1
diff -u -p -r1.1 taxonomy.schema
--- modules/taxonomy/taxonomy.schema	25 May 2007 12:46:46 -0000	1.1
+++ modules/taxonomy/taxonomy.schema	26 May 2007 16:06:05 -0000
@@ -2,7 +2,7 @@
 // $Id: taxonomy.schema,v 1.1 2007/05/25 12:46:46 dries Exp $
 
 function taxonomy_schema() {
-  $schema['term_data'] = array(
+  $schema['term'] = array(
     'fields' => array(
       'tid'         => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
       'vid'         => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
@@ -87,7 +87,7 @@ function taxonomy_schema() {
     'primary key' => array('vid'),
   );
 
-  $schema['vocabulary_node_types'] = array(
+  $schema['vocabulary_node_type'] = array(
     'fields' => array(
       'vid'  => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
       'type' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => '')
Index: modules/tracker/tracker.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/tracker/tracker.module,v
retrieving revision 1.148
diff -u -p -r1.148 tracker.module
--- modules/tracker/tracker.module	16 May 2007 13:45:16 -0000	1.148
+++ modules/tracker/tracker.module	26 May 2007 16:06:05 -0000
@@ -83,14 +83,14 @@ function tracker_page($uid = 0) {
 
   // TODO: These queries are very expensive, see http://drupal.org/node/105639
   if ($uid) {
-    $sql = 'SELECT DISTINCT(n.nid), n.title, n.type, n.changed, n.uid, u.name, GREATEST(n.changed, l.last_comment_timestamp) AS last_updated, l.comment_count FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid INNER JOIN {users} u ON n.uid = u.uid LEFT JOIN {comments} c ON n.nid = c.nid AND (c.status = %d OR c.status IS NULL) WHERE n.status = 1 AND (n.uid = %d OR c.uid = %d) ORDER BY last_updated DESC';
+    $sql = 'SELECT DISTINCT(n.nid), n.title, n.type, n.changed, n.uid, u.name, GREATEST(n.changed, l.last_comment_timestamp) AS last_updated, l.comment_count FROM {node} n INNER JOIN {node_comment_statistic} l ON n.nid = l.nid INNER JOIN {user} u ON n.uid = u.uid LEFT JOIN {comment} c ON n.nid = c.nid AND (c.status = %d OR c.status IS NULL) WHERE n.status = 1 AND (n.uid = %d OR c.uid = %d) ORDER BY last_updated DESC';
     $sql = db_rewrite_sql($sql);
-    $sql_count = 'SELECT COUNT(DISTINCT(n.nid)) FROM {node} n LEFT JOIN {comments} c ON n.nid = c.nid AND (c.status = %d OR c.status IS NULL) WHERE n.status = 1 AND (n.uid = %d OR c.uid = %d)';
+    $sql_count = 'SELECT COUNT(DISTINCT(n.nid)) FROM {node} n LEFT JOIN {comment} c ON n.nid = c.nid AND (c.status = %d OR c.status IS NULL) WHERE n.status = 1 AND (n.uid = %d OR c.uid = %d)';
     $sql_count = db_rewrite_sql($sql_count);
     $result = pager_query($sql, 25, 0, $sql_count, COMMENT_PUBLISHED, $uid, $uid);
   }
   else {
-    $sql = 'SELECT DISTINCT(n.nid), n.title, n.type, n.changed, n.uid, u.name, GREATEST(n.changed, l.last_comment_timestamp) AS last_updated, l.comment_count FROM {node} n INNER JOIN {users} u ON n.uid = u.uid INNER JOIN {node_comment_statistics} l ON n.nid = l.nid WHERE n.status = 1 ORDER BY last_updated DESC';
+    $sql = 'SELECT DISTINCT(n.nid), n.title, n.type, n.changed, n.uid, u.name, GREATEST(n.changed, l.last_comment_timestamp) AS last_updated, l.comment_count FROM {node} n INNER JOIN {user} u ON n.uid = u.uid INNER JOIN {node_comment_statistic} l ON n.nid = l.nid WHERE n.status = 1 ORDER BY last_updated DESC';
     $sql = db_rewrite_sql($sql);
     $sql_count = 'SELECT COUNT(n.nid) FROM {node} n WHERE n.status = 1';
     $sql_count = db_rewrite_sql($sql_count);
Index: modules/upload/upload.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.module,v
retrieving revision 1.160
diff -u -p -r1.160 upload.module
--- modules/upload/upload.module	14 May 2007 13:43:38 -0000	1.160
+++ modules/upload/upload.module	26 May 2007 16:06:06 -0000
@@ -272,7 +272,7 @@ function upload_download() {
 
 function upload_file_download($file) {
   $file = file_create_path($file);
-  $result = db_query("SELECT f.* FROM {files} f WHERE filepath = '%s'", $file);
+  $result = db_query("SELECT f.* FROM {file} f WHERE filepath = '%s'", $file);
   if ($file = db_fetch_object($result)) {
     if (user_access('view uploaded files')) {
       $node = node_load($file->nid);
@@ -616,7 +616,7 @@ function theme_upload_attachments($files
  *   The amount of disk space used by the user in bytes.
  */
 function upload_space_used($uid) {
-  return db_result(db_query('SELECT SUM(filesize) FROM {files} f INNER JOIN {node} n ON f.nid = n.nid WHERE n.uid = %d', $uid));
+  return db_result(db_query('SELECT SUM(filesize) FROM {file} f INNER JOIN {node} n ON f.nid = n.nid WHERE n.uid = %d', $uid));
 }
 
 /**
@@ -626,7 +626,7 @@ function upload_space_used($uid) {
  *   The amount of disk space used by uploaded files in bytes.
  */
 function upload_total_space_used() {
-  return db_result(db_query('SELECT SUM(filesize) FROM {files}'));
+  return db_result(db_query('SELECT SUM(filesize) FROM {file}'));
 }
 
 /**
@@ -708,11 +708,11 @@ function upload_save(&$node) {
 
       // Remove managed files.
       else {
-        db_query('DELETE FROM {file_revisions} WHERE fid = %d AND vid = %d', $fid, $node->vid);
+        db_query('DELETE FROM {file_revision} WHERE fid = %d AND vid = %d', $fid, $node->vid);
         // Only delete a file if it isn't used by any revision
-        $count = db_result(db_query('SELECT COUNT(fid) FROM {file_revisions} WHERE fid = %d', $fid));
+        $count = db_result(db_query('SELECT COUNT(fid) FROM {file_revision} WHERE fid = %d', $fid));
         if ($count < 1) {
-          db_query('DELETE FROM {files} WHERE fid = %d', $fid);
+          db_query('DELETE FROM {file} WHERE fid = %d', $fid);
           file_delete($file->filepath);
         }
       }
@@ -721,9 +721,9 @@ function upload_save(&$node) {
     // New file upload
     elseif (strpos($file->fid, 'upload') !== FALSE) {
       if ($file = file_save_upload($file, $file->filename)) {
-        $file->fid = db_next_id('{files}_fid');
-        db_query("INSERT INTO {files} (fid, nid, filename, filepath, filemime, filesize) VALUES (%d, %d, '%s', '%s', '%s', %d)", $file->fid, $node->nid, $file->filename, $file->filepath, $file->filemime, $file->filesize);
-        db_query("INSERT INTO {file_revisions} (fid, vid, list, description) VALUES (%d, %d, %d, '%s')", $file->fid, $node->vid, $file->list, $file->description);
+        $file->fid = db_next_id('{file}_fid');
+        db_query("INSERT INTO {file} (fid, nid, filename, filepath, filemime, filesize) VALUES (%d, %d, '%s', '%s', '%s', %d)", $file->fid, $node->nid, $file->filename, $file->filepath, $file->filemime, $file->filesize);
+        db_query("INSERT INTO {file_revision} (fid, vid, list, description) VALUES (%d, %d, %d, '%s')", $file->fid, $node->vid, $file->list, $file->description);
         // Tell other modules where the file was stored.
         $node->files[$fid] = $file;
       }
@@ -732,49 +732,49 @@ function upload_save(&$node) {
 
     // Create a new revision, as needed
     elseif ($node->old_vid && is_numeric($fid)) {
-      db_query("INSERT INTO {file_revisions} (fid, vid, list, description) VALUES (%d, %d, %d, '%s')", $file->fid, $node->vid, $file->list, $file->description);
+      db_query("INSERT INTO {file_revision} (fid, vid, list, description) VALUES (%d, %d, %d, '%s')", $file->fid, $node->vid, $file->list, $file->description);
     }
 
     // Update existing revision
     else {
-      db_query("UPDATE {file_revisions} SET list = %d, description = '%s' WHERE fid = %d AND vid = %d", $file->list, $file->description, $file->fid, $node->vid);
+      db_query("UPDATE {file_revision} SET list = %d, description = '%s' WHERE fid = %d AND vid = %d", $file->list, $file->description, $file->fid, $node->vid);
     }
   }
 }
 
 function upload_delete($node) {
   $files = array();
-  $result = db_query('SELECT * FROM {files} WHERE nid = %d', $node->nid);
+  $result = db_query('SELECT * FROM {file} WHERE nid = %d', $node->nid);
   while ($file = db_fetch_object($result)) {
     $files[$file->fid] = $file;
   }
 
   foreach ($files as $fid => $file) {
     // Delete all file revision information associated with the node
-    db_query('DELETE FROM {file_revisions} WHERE fid = %d', $fid);
+    db_query('DELETE FROM {file_revision} WHERE fid = %d', $fid);
     file_delete($file->filepath);
   }
 
   // Delete all files associated with the node
-  db_query('DELETE FROM {files} WHERE nid = %d', $node->nid);
+  db_query('DELETE FROM {file} WHERE nid = %d', $node->nid);
 }
 
 function upload_delete_revision($node) {
   if (is_array($node->files)) {
     foreach ($node->files as $file) {
       // Check if the file will be used after this revision is deleted
-      $count = db_result(db_query('SELECT COUNT(fid) FROM {file_revisions} WHERE fid = %d', $file->fid));
+      $count = db_result(db_query('SELECT COUNT(fid) FROM {file_revision} WHERE fid = %d', $file->fid));
 
       // if the file won't be used, delete it
       if ($count < 2) {
-        db_query('DELETE FROM {files} WHERE fid = %d', $file->fid);
+        db_query('DELETE FROM {file} WHERE fid = %d', $file->fid);
         file_delete($file->filepath);
       }
     }
   }
 
   // delete the revision
-  db_query('DELETE FROM {file_revisions} WHERE vid = %d', $node->vid);
+  db_query('DELETE FROM {file_revision} WHERE vid = %d', $node->vid);
 }
 
 function _upload_form($node) {
@@ -861,7 +861,7 @@ function upload_load($node) {
   $files = array();
 
   if ($node->vid) {
-    $result = db_query('SELECT * FROM {files} f INNER JOIN {file_revisions} r ON f.fid = r.fid WHERE r.vid = %d ORDER BY f.fid', $node->vid);
+    $result = db_query('SELECT * FROM {file} f INNER JOIN {file_revision} r ON f.fid = r.fid WHERE r.vid = %d ORDER BY f.fid', $node->vid);
     while ($file = db_fetch_object($result)) {
       $files[$file->fid] = $file;
     }
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.786
diff -u -p -r1.786 user.module
--- modules/user/user.module	25 May 2007 12:52:16 -0000	1.786
+++ modules/user/user.module	26 May 2007 16:06:09 -0000
@@ -103,7 +103,7 @@ function user_load($array = array()) {
       $params[] = $value;
     }
   }
-  $result = db_query('SELECT * FROM {users} u WHERE '. implode(' AND ', $query), $params);
+  $result = db_query('SELECT * FROM {user} u WHERE '. implode(' AND ', $query), $params);
 
   if (db_num_rows($result)) {
     $user = db_fetch_object($result);
@@ -116,7 +116,7 @@ function user_load($array = array()) {
     else {
       $user->roles[DRUPAL_ANONYMOUS_RID] = 'anonymous user';
     }
-    $result = db_query('SELECT r.rid, r.name FROM {role} r INNER JOIN {users_roles} ur ON ur.rid = r.rid WHERE ur.uid = %d', $user->uid);
+    $result = db_query('SELECT r.rid, r.name FROM {role} r INNER JOIN {user_role} ur ON ur.rid = r.rid WHERE ur.uid = %d', $user->uid);
     while ($role = db_fetch_object($result)) {
       $user->roles[$role->rid] = $role->name;
     }
@@ -154,7 +154,7 @@ function user_save($account, $array = ar
       _user_mail_notify($op, $account);
     }
     $query = '';
-    $data = unserialize(db_result(db_query('SELECT data FROM {users} WHERE uid = %d', $account->uid)));
+    $data = unserialize(db_result(db_query('SELECT data FROM {user} WHERE uid = %d', $account->uid)));
     foreach ($array as $key => $value) {
       if ($key == 'pass' && !empty($value)) {
         $query .= "$key = '%s', ";
@@ -180,15 +180,15 @@ function user_save($account, $array = ar
     $query .= "data = '%s' ";
     $v[] = serialize($data);
 
-    db_query("UPDATE {users} SET $query WHERE uid = %d", array_merge($v, array($account->uid)));
+    db_query("UPDATE {user} SET $query WHERE uid = %d", array_merge($v, array($account->uid)));
 
     // Reload user roles if provided
     if (isset($array['roles']) && is_array($array['roles'])) {
-      db_query('DELETE FROM {users_roles} WHERE uid = %d', $account->uid);
+      db_query('DELETE FROM {user_role} WHERE uid = %d', $account->uid);
 
       foreach (array_keys($array['roles']) as $rid) {
         if (!in_array($rid, array(DRUPAL_ANONYMOUS_RID, DRUPAL_AUTHENTICATED_RID))) {
-          db_query('INSERT INTO {users_roles} (uid, rid) VALUES (%d, %d)', $account->uid, $rid);
+          db_query('INSERT INTO {user_role} (uid, rid) VALUES (%d, %d)', $account->uid, $rid);
         }
       }
     }
@@ -210,7 +210,7 @@ function user_save($account, $array = ar
     user_module_invoke('after_update', $array, $user, $category);
   }
   else {
-    $array['uid'] = db_next_id('{users}_uid');
+    $array['uid'] = db_next_id('{user}_uid');
 
     if (!isset($array['created'])) {    // Allow 'created' to be set by hook_auth
       $array['created'] = time();
@@ -242,7 +242,7 @@ function user_save($account, $array = ar
           break;
       }
     }
-    db_query('INSERT INTO {users} ('. implode(', ', $fields) .') VALUES ('. implode(', ', $s) .')', $values);
+    db_query('INSERT INTO {user} ('. implode(', ', $fields) .') VALUES ('. implode(', ', $s) .')', $values);
 
     // Build the initial user object.
     $user = user_load(array('uid' => $array['uid']));
@@ -256,14 +256,14 @@ function user_save($account, $array = ar
         $data[$key] = $value;
       }
     }
-    db_query("UPDATE {users} SET data = '%s' WHERE uid = %d", serialize($data), $user->uid);
+    db_query("UPDATE {user} SET data = '%s' WHERE uid = %d", serialize($data), $user->uid);
 
     // Save user roles (delete just to be safe).
     if (is_array($array['roles'])) {
-      db_query('DELETE FROM {users_roles} WHERE uid = %d', $array['uid']);
+      db_query('DELETE FROM {user_role} WHERE uid = %d', $array['uid']);
       foreach (array_keys($array['roles']) as $rid) {
         if (!in_array($rid, array(DRUPAL_ANONYMOUS_RID, DRUPAL_AUTHENTICATED_RID))) {
-          db_query('INSERT INTO {users_roles} (uid, rid) VALUES (%d, %d)', $array['uid'], $rid);
+          db_query('INSERT INTO {user_role} (uid, rid) VALUES (%d, %d)', $array['uid'], $rid);
         }
       }
     }
@@ -429,7 +429,7 @@ function user_access($string, $account =
  * @return boolean TRUE for blocked users, FALSE for active
  */
 function user_is_blocked($name) {
-  $deny  = db_fetch_object(db_query("SELECT name FROM {users} WHERE status = 0 AND name = LOWER('%s')", $name));
+  $deny  = db_fetch_object(db_query("SELECT name FROM {user} WHERE status = 0 AND name = LOWER('%s')", $name));
 
   return $deny;
 }
@@ -438,7 +438,7 @@ function user_fields() {
   static $fields;
 
   if (!$fields) {
-    $result = db_query('SELECT * FROM {users} WHERE uid = 1');
+    $result = db_query('SELECT * FROM {user} WHERE uid = 1');
     if (db_num_rows($result)) {
       $fields = array_keys(db_fetch_array($result));
     }
@@ -484,7 +484,7 @@ function user_search($op = 'search', $ke
         $find = array();
         // Replace wildcards with MySQL/PostgreSQL wildcards.
         $keys = preg_replace('!\*+!', '%', $keys);
-        $result = pager_query("SELECT uid, name FROM {users} WHERE LOWER(name) LIKE LOWER('%%%s%%')", 15, 0, NULL, $keys);
+        $result = pager_query("SELECT uid, name FROM {user} WHERE LOWER(name) LIKE LOWER('%%%s%%')", 15, 0, NULL, $keys);
         while ($account = db_fetch_object($result)) {
           $find[] = array('title' => $account->name, 'link' => url('user/'. $account->uid, array('absolute' => TRUE)));
         }
@@ -613,7 +613,7 @@ function user_block($op = 'list', $delta
       case 2:
         if (user_access('access content')) {
           // Retrieve a list of new users who have subsequently accessed the site successfully.
-          $result = db_query_range('SELECT uid, name FROM {users} WHERE status != 0 AND access != 0 ORDER BY created DESC', 0, variable_get('user_block_whois_new_count', 5));
+          $result = db_query_range('SELECT uid, name FROM {user} WHERE status != 0 AND access != 0 ORDER BY created DESC', 0, variable_get('user_block_whois_new_count', 5));
           while ($account = db_fetch_object($result)) {
             $items[] = $account;
           }
@@ -632,7 +632,7 @@ function user_block($op = 'list', $delta
           // Perform database queries to gather online user lists.  We use s.timestamp
           // rather than u.access because it is much faster is much faster..
           $anonymous_count = sess_count($interval);
-          $authenticated_users = db_query('SELECT DISTINCT u.uid, u.name FROM {users} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.timestamp >= %d AND s.uid > 0 ORDER BY s.timestamp DESC', $interval);
+          $authenticated_users = db_query('SELECT DISTINCT u.uid, u.name FROM {user} u INNER JOIN {session} s ON u.uid = s.uid WHERE s.timestamp >= %d AND s.uid > 0 ORDER BY s.timestamp DESC', $interval);
           $authenticated_count = db_num_rows($authenticated_users);
 
           // Format the output with proper grammar.
@@ -1093,7 +1093,7 @@ function user_login_submit($form_values,
     watchdog('user', 'Session opened for %name.', array('%name' => $user->name));
 
     // Update the user table timestamp noting user has logged in.
-    db_query("UPDATE {users} SET login = %d WHERE uid = %d", time(), $user->uid);
+    db_query("UPDATE {user} SET login = %d WHERE uid = %d", time(), $user->uid);
 
     user_module_invoke('login', $form_values, $user);
 
@@ -1242,7 +1242,7 @@ function user_pass_reset($uid, $timestam
           watchdog('user', 'User %name used one-time login link at time %timestamp.', array('%name' => $account->name, '%timestamp' => $timestamp));
           // Update the user table noting user has logged in.
           // And this also makes this hashed password a one-time-only login.
-          db_query("UPDATE {users} SET login = %d WHERE uid = %d", time(), $account->uid);
+          db_query("UPDATE {user} SET login = %d WHERE uid = %d", time(), $account->uid);
           // Now we can set the new user.
           $user = $account;
           // And proceed with normal login, going to user page.
@@ -1513,7 +1513,7 @@ function _user_edit_validate($uid, &$edi
     if ($error = user_validate_name($edit['name'])) {
       form_set_error('name', $error);
     }
-    else if (db_num_rows(db_query("SELECT uid FROM {users} WHERE uid != %d AND LOWER(name) = LOWER('%s')", $uid, $edit['name'])) > 0) {
+    else if (db_num_rows(db_query("SELECT uid FROM {user} WHERE uid != %d AND LOWER(name) = LOWER('%s')", $uid, $edit['name'])) > 0) {
       form_set_error('name', t('The name %name is already taken.', array('%name' => $edit['name'])));
     }
     else if (drupal_is_denied('user', $edit['name'])) {
@@ -1525,7 +1525,7 @@ function _user_edit_validate($uid, &$edi
   if ($error = user_validate_mail($edit['mail'])) {
     form_set_error('mail', $error);
   }
-  else if (db_num_rows(db_query("SELECT uid FROM {users} WHERE uid != %d AND LOWER(mail) = LOWER('%s')", $uid, $edit['mail'])) > 0) {
+  else if (db_num_rows(db_query("SELECT uid FROM {user} WHERE uid != %d AND LOWER(mail) = LOWER('%s')", $uid, $edit['mail'])) > 0) {
     form_set_error('mail', t('The e-mail address %email is already registered. <a href="@password">Have you forgotten your password?</a>', array('%email' => $edit['mail'], '@password' => url('user/password'))));
   }
   else if (drupal_is_denied('mail', $edit['mail'])) {
@@ -1609,8 +1609,8 @@ function user_delete($edit, $uid) {
   $account = user_load(array('uid' => $uid));
   sess_destroy_uid($uid);
   _user_mail_notify('status_deleted', $account);
-  db_query('DELETE FROM {users} WHERE uid = %d', $uid);
-  db_query('DELETE FROM {users_roles} WHERE uid = %d', $uid);
+  db_query('DELETE FROM {user} WHERE uid = %d', $uid);
+  db_query('DELETE FROM {user_role} WHERE uid = %d', $uid);
   db_query('DELETE FROM {authmap} WHERE uid = %d', $uid);
   $variables = array('%name' => $account->name, '%email' => '<'. $account->mail .'>');
   watchdog('user', 'Deleted user: %name %email.', $variables, WATCHDOG_NOTICE);
@@ -2120,7 +2120,7 @@ function user_admin_role_submit($form_va
     db_query('DELETE FROM {role} WHERE rid = %d', $form_values['rid']);
     db_query('DELETE FROM {permission} WHERE rid = %d', $form_values['rid']);
     // Update the users who have this role set:
-    db_query('DELETE FROM {users_roles} WHERE rid = %d', $form_values['rid']);
+    db_query('DELETE FROM {user_role} WHERE rid = %d', $form_values['rid']);
 
     drupal_set_message(t('The role has been deleted.'));
   }
@@ -2164,7 +2164,7 @@ function user_admin_account() {
     t('Operations')
   );
 
-  $sql = 'SELECT DISTINCT u.uid, u.name, u.status, u.created, u.access FROM {users} u LEFT JOIN {users_roles} ur ON u.uid = ur.uid '. $filter['join'] .' WHERE u.uid != 0 '. $filter['where'];
+  $sql = 'SELECT DISTINCT u.uid, u.name, u.status, u.created, u.access FROM {user} u LEFT JOIN {user_role} ur ON u.uid = ur.uid '. $filter['join'] .' WHERE u.uid != 0 '. $filter['where'];
   $sql .= tablesort_sql($header);
   $result = pager_query($sql, 50, 0, NULL, $filter['args']);
 
@@ -2198,7 +2198,7 @@ function user_admin_account() {
     $form['name'][$account->uid] = array('#value' => theme('username', $account));
     $form['status'][$account->uid] =  array('#value' => $status[$account->status]);
     $users_roles = array();
-    $roles_result = db_query('SELECT rid FROM {users_roles} WHERE uid = %d', $account->uid);
+    $roles_result = db_query('SELECT rid FROM {user_role} WHERE uid = %d', $account->uid);
     while ($user_role = db_fetch_object($roles_result)) {
       $users_roles[] = $roles[$user_role->rid];
     }
@@ -2423,7 +2423,7 @@ function user_multiple_delete_confirm() 
   $form['accounts'] = array('#prefix' => '<ul>', '#suffix' => '</ul>', '#tree' => TRUE);
   // array_filter returns only elements with TRUE values
   foreach (array_filter($edit['accounts']) as $uid => $value) {
-    $user = db_result(db_query('SELECT name FROM {users} WHERE uid = %d', $uid));
+    $user = db_result(db_query('SELECT name FROM {user} WHERE uid = %d', $uid));
     $form['accounts'][$uid] = array('#type' => 'hidden', '#value' => $uid, '#prefix' => '<li>', '#suffix' => check_plain($user) ."</li>\n");
   }
   $form['operation'] = array('#type' => 'hidden', '#value' => 'delete');
@@ -2835,7 +2835,7 @@ function _user_forms(&$edit, $account, $
 function user_autocomplete($string = '') {
   $matches = array();
   if ($string) {
-    $result = db_query_range("SELECT name FROM {users} WHERE LOWER(name) LIKE LOWER('%s%%')", $string, 0, 10);
+    $result = db_query_range("SELECT name FROM {user} WHERE LOWER(name) LIKE LOWER('%s%%')", $string, 0, 10);
     while ($user = db_fetch_object($result)) {
       $matches[$user->name] = check_plain($user->name);
    }
Index: modules/user/user.schema
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.schema,v
retrieving revision 1.1
diff -u -p -r1.1 user.schema
--- modules/user/user.schema	25 May 2007 12:46:46 -0000	1.1
+++ modules/user/user.schema	26 May 2007 16:06:09 -0000
@@ -43,7 +43,7 @@ function user_schema() {
     'primary key' => array('rid'),
   );
 
-  $schema['users'] = array(
+  $schema['user'] = array(
     'fields' => array(
       'uid'       => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
       'name'      => array('type' => 'varchar', 'length' => 60, 'not null' => TRUE, 'default' => ''),
@@ -72,7 +72,7 @@ function user_schema() {
     'primary key' => array('uid'),
   );
 
-  $schema['users_roles'] = array(
+  $schema['user_role'] = array(
     'fields' => array(
       'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
       'rid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0)
