Index: database.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database/database.inc,v
retrieving revision 1.4
diff -u -p -r1.4 database.inc
--- database.inc	8 Sep 2008 21:24:30 -0000	1.4
+++ database.inc	14 Sep 2008 00:22:11 -0000
@@ -1007,7 +1007,8 @@ class DatabaseStatement extends PDOState
   public function execute($args, $options) {
     if (isset($options['fetch'])) {
       if (is_string($options['fetch'])) {
-        $this->setFetchMode(PDO::FETCH_CLASS, $options['fetch']);
+        // PDO::FETCH_PROPS_LATE tells __construct() to run before properties are added to the object.
+        $this->setFetchMode(PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE, $options['fetch']);
       }
       else {
         $this->setFetchMode($options['fetch']);
