? db_fetch_object.patch
Index: includes/database.mysql.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/Attic/database.mysql.inc,v
retrieving revision 1.89.2.2
diff -u -p -r1.89.2.2 database.mysql.inc
--- includes/database.mysql.inc	1 Feb 2010 16:32:10 -0000	1.89.2.2
+++ includes/database.mysql.inc	23 Oct 2010 04:13:29 -0000
@@ -135,13 +135,15 @@ function _db_query($query, $debug = 0) {
  *
  * @param $result
  *   A database query result resource, as returned from db_query().
+ * @param $class_name
+ *   Class name to type-cast the DB row to.
  * @return
  *   An object representing the next row of the result, or FALSE. The attributes
  *   of this object are the table fields selected by the query.
  */
-function db_fetch_object($result) {
+function db_fetch_object($result, $class_name = NULL) {
   if ($result) {
-    return mysql_fetch_object($result);
+    return mysql_fetch_object($result, $class_name);
   }
 }
 
Index: includes/database.mysqli.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/Attic/database.mysqli.inc,v
retrieving revision 1.54.2.2
diff -u -p -r1.54.2.2 database.mysqli.inc
--- includes/database.mysqli.inc	1 Feb 2010 16:32:10 -0000	1.54.2.2
+++ includes/database.mysqli.inc	23 Oct 2010 04:13:29 -0000
@@ -135,13 +135,15 @@ function _db_query($query, $debug = 0) {
  *
  * @param $result
  *   A database query result resource, as returned from db_query().
+ * @param $classname
+ *   Class name to type-cast the DB row to.
  * @return
  *   An object representing the next row of the result, or FALSE. The attributes
  *   of this object are the table fields selected by the query.
  */
-function db_fetch_object($result) {
+function db_fetch_object($result, $class_name = NULL) {
   if ($result) {
-    $object = mysqli_fetch_object($result);
+    $object = mysqli_fetch_object($result, $class_name);
     return isset($object) ? $object : FALSE;
   }
 }
Index: includes/database.pgsql.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/Attic/database.pgsql.inc,v
retrieving revision 1.68.2.9
diff -u -p -r1.68.2.9 database.pgsql.inc
--- includes/database.pgsql.inc	28 May 2010 15:02:16 -0000	1.68.2.9
+++ includes/database.pgsql.inc	23 Oct 2010 04:13:29 -0000
@@ -167,13 +167,15 @@ function _db_query($query, $debug = 0) {
  *
  * @param $result
  *   A database query result resource, as returned from db_query().
+ * @param $class_name
+ *   Class name to type-cast the DB row to.
  * @return
  *   An object representing the next row of the result, or FALSE. The attributes
  *   of this object are the table fields selected by the query.
  */
-function db_fetch_object($result) {
+function db_fetch_object($result, $class_name = NULL) {
   if ($result) {
-    return pg_fetch_object($result);
+    return pg_fetch_object($result, NULL, $class_name);
   }
 }
 
