--- email_registration.module~	2008-02-17 01:02:28.000000000 +0000
+++ email_registration.module	2009-04-04 21:47:58.000000000 +0000
@@ -10,13 +10,7 @@
   switch ($op) {
     case 'insert':
     $namenew = preg_replace('/@.*$/', '', $edit['mail']);
-    // if username generated from email record already exists, append underscore and number eg:(chris_123)
-    if (db_num_rows(db_query("SELECT uid FROM {users} WHERE uid != %d AND LOWER(name) = LOWER('%s')", $account->uid, $namenew)) > 0) {
-      // find the next number available to append to the name
-      $sql = "SELECT SUBSTRING_INDEX(name,'_',-1) FROM {users} WHERE name REGEXP '^%s_[0-9]+$' ORDER BY CAST(SUBSTRING_INDEX(name,'_',-1) AS UNSIGNED) DESC LIMIT 1";
-      $nameidx = db_result(db_query($sql, $namenew));
-      $namenew .= '_'. ($nameidx + 1);
-    }
+    $namenew .= '_'.$account->uid;
     // replace with generated username
     db_query("UPDATE {users} SET name = '%s' WHERE uid = '%s'", $namenew, $account->uid);
   break;
