Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.968
diff -u -r1.968 common.inc
--- includes/common.inc	22 Aug 2009 19:58:27 -0000	1.968
+++ includes/common.inc	23 Aug 2009 12:49:40 -0000
@@ -4544,12 +4544,12 @@
   if ($prefix) {
     $columns = array();
     foreach ($fields as $field) {
-      $columns[] = "$prefix.$field";
+      $columns["$prefix.$field"] = "$prefix.$field";
     }
     return $columns;
   }
   else {
-    return $fields;
+    return drupal_map_assoc($fields);
   }
 }
 
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1106
diff -u -r1.1106 node.module
--- modules/node/node.module	23 Aug 2009 01:05:11 -0000	1.1106
+++ modules/node/node.module	23 Aug 2009 12:55:33 -0000
@@ -810,6 +810,12 @@
     // nid is provided by node, so remove it.
     unset($node_revision_fields['nid']);
 
+    // Create an alias for {node_revision}.uid to avoid the name collision
+    // with {node}.uid, otherwise the Author of the {node}.uid is never
+    // updated when editing a node.
+    unset($node_revision_fields['uid']);
+    $query->addField('r', 'uid', 'revision_uid');
+
     // Change timestamp to revision_timestamp before adding it to the query.
     unset($node_revision_fields['timestamp']);
     $query->addField('r', 'timestamp', 'revision_timestamp');
Index: modules/node/node.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.test,v
retrieving revision 1.41
diff -u -r1.41 node.test
--- modules/node/node.test	23 Aug 2009 04:37:52 -0000	1.41
+++ modules/node/node.test	23 Aug 2009 14:27:08 -0000
@@ -219,6 +219,29 @@
     // Check that the title and body fields are displayed with the updated values.
     $this->assertText($edit['title'], t('Title displayed.'));
     $this->assertText($edit[$body_key], t('Body displayed.'));
+
+    // Login as a second administrator user.
+    $second_web_user = $this->drupalCreateUser(array('administer nodes', 'edit any page content'));
+    $this->drupalLogin($second_web_user);
+    // Edit the same node, creating a new revision.
+    $this->drupalGet("node/$node->nid/edit");
+    $edit = array();
+    $edit['title'] = $this->randomName(8);
+    $edit[$body_key] = $this->randomName(16);
+    $edit['revision'] = TRUE;
+    $this->drupalPost(NULL, $edit, t('Save'));
+
+    // Ensure that the node revision has been created.
+    $revised_node = $this->drupalGetNodeByTitle($edit['title']);
+    $this->assertNotIdentical($node->vid, $revised_node->vid, 'A new revision has been created.');
+    // Ensure that the Author user id of the original node is preserved when
+    // it was not changed in the edit form.
+    $this->assertIdentical($node->uid, $revised_node->uid, 'The node author has been preserved.');
+    // Ensure that the Author user id of the versions of the nodes are
+    // different since they have been created by different users.
+    $first_node_version = node_load($node->nid, $node->vid);
+    $second_node_version = node_load($node->nid, $revised_node->vid);
+    $this->assertNotIdentical($first_node_version->revision_uid, $second_node_version->revision_uid, 'Each revision has a distinct user.');
   }
 }
 
Index: modules/user/user.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.test,v
retrieving revision 1.56
diff -u -r1.56 user.test
--- modules/user/user.test	21 Aug 2009 14:27:47 -0000	1.56
+++ modules/user/user.test	23 Aug 2009 12:49:41 -0000
@@ -479,7 +479,7 @@
     $test_node = node_load($node->nid, NULL, TRUE);
     $this->assertTrue(($test_node->uid == 0 && $test_node->status == 1), t('Node of the user has been attributed to anonymous user.'));
     $test_node = node_load($revision_node->nid, $revision, TRUE);
-    $this->assertTrue(($test_node->uid == 0 && $test_node->status == 1), t('Node revision of the user has been attributed to anonymous user.'));
+    $this->assertTrue(($test_node->revision_uid == 0 && $test_node->status == 1), t('Node revision of the user has been attributed to anonymous user.'));
     $test_node = node_load($revision_node->nid, NULL, TRUE);
     $this->assertTrue(($test_node->uid != 0 && $test_node->status == 1), t("Current revision of the user's node was not attributed to anonymous user."));
 
