=== modified file 'includes/database/database.inc'
--- includes/database/database.inc	2010-08-17 15:30:01 +0000
+++ includes/database/database.inc	2010-08-25 00:30:51 +0000
@@ -188,14 +188,14 @@ abstract class DatabaseConnection extend
    *
    * @var string
    */
-  protected $target = NULL;
+  public $_target = NULL;
 
   /**
    * The current database logging object for this connection.
    *
    * @var DatabaseLog
    */
-  protected $logger = NULL;
+  public $_logger = NULL;
 
   /**
    * Tracks the number of "layers" of transactions currently active.
@@ -206,28 +206,28 @@ abstract class DatabaseConnection extend
    *
    * @var array
    */
-  protected $transactionLayers = array();
+  public $_transactionLayers = array();
 
   /**
    * Index of what driver-specific class to use for various operations.
    *
    * @var array
    */
-  protected $driverClasses = array();
+  public $_driverClasses = array();
 
   /**
    * The name of the Statement class for this connection.
    *
    * @var string
    */
-  protected $statementClass = 'DatabaseStatementBase';
+  public $_statementClass = 'DatabaseStatementBase';
 
   /**
    * Whether this database connection supports transactions.
    *
    * @var bool
    */
-  protected $transactionSupport = TRUE;
+  public $_transactionSupport = TRUE;
 
   /**
    * Whether this database connection supports transactional DDL.
@@ -236,28 +236,28 @@ abstract class DatabaseConnection extend
    *
    * @var bool
    */
-  protected $transactionalDDLSupport = FALSE;
+  public $_transactionalDDLSupport = FALSE;
 
   /**
    * An index used to generate unique temporary table names.
    *
    * @var integer
    */
-  protected $temporaryNameIndex = 0;
+  public $_temporaryNameIndex = 0;
 
   /**
    * The connection information for this connection object.
    *
    * @var array
    */
-  protected $connectionOptions = array();
+  public $_connectionOptions = array();
 
   /**
    * The schema object for this connection.
    *
    * @var object
    */
-  protected $schema = NULL;
+  public $_schema = NULL;
 
   /**
    * The default prefix used by this database connection.
@@ -266,18 +266,18 @@ abstract class DatabaseConnection extend
    *
    * @var string
    */
-  protected $defaultPrefix = '';
+  public $_defaultPrefix = '';
 
   /**
    * The non-default prefixes used by this database connection.
    *
    * @var array
    */
-  protected $prefixes = array();
+  public $_prefixes = array();
 
   function __construct($dsn, $username, $password, $driver_options = array()) {
     // Initialize and prepare the connection prefix.
-    $this->setPrefix(isset($this->connectionOptions['prefix']) ? $this->connectionOptions['prefix'] : '');
+    $this->setPrefix(isset($this->_connectionOptions['prefix']) ? $this->_connectionOptions['prefix'] : '');
 
     // Because the other methods don't seem to work right.
     $driver_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
@@ -286,8 +286,8 @@ abstract class DatabaseConnection extend
     parent::__construct($dsn, $username, $password, $driver_options);
 
     // Set a specific PDOStatement class if the driver requires that.
-    if (!empty($this->statementClass)) {
-      $this->setAttribute(PDO::ATTR_STATEMENT_CLASS, array($this->statementClass, array($this)));
+    if (!empty($this->_statementClass)) {
+      $this->setAttribute(PDO::ATTR_STATEMENT_CLASS, array($this->_statementClass, array($this)));
     }
   }
 
@@ -358,7 +358,7 @@ abstract class DatabaseConnection extend
    *   properties is driver-dependent.
    */
   public function getConnectionOptions() {
-    return $this->connectionOptions;
+    return $this->_connectionOptions;
   }
 
   /**
@@ -370,13 +370,13 @@ abstract class DatabaseConnection extend
    */
   protected function setPrefix($prefix) {
     if (is_array($prefix)) {
-      $this->defaultPrefix = isset($prefix['default']) ? $prefix['default'] : '';
+      $this->_defaultPrefix = isset($prefix['default']) ? $prefix['default'] : '';
       unset($prefix['default']);
-      $this->prefixes = $prefix;
+      $this->_prefixes = $prefix;
     }
     else {
-      $this->defaultPrefix = $prefix;
-      $this->prefixes = array();
+      $this->_defaultPrefix = $prefix;
+      $this->_prefixes = array();
     }
   }
 
@@ -396,11 +396,11 @@ abstract class DatabaseConnection extend
    */
   public function prefixTables($sql) {
     // Replace specific table prefixes first.
-    foreach ($this->prefixes as $key => $val) {
+    foreach ($this->_prefixes as $key => $val) {
       $sql = strtr($sql, array('{' . $key . '}' => $val . $key));
     }
     // Then replace remaining tables with the default prefix.
-    return strtr($sql, array('{' => $this->defaultPrefix , '}' => ''));
+    return strtr($sql, array('{' => $this->_defaultPrefix , '}' => ''));
   }
 
   /**
@@ -410,11 +410,11 @@ abstract class DatabaseConnection extend
    * is not used in prefixTables due to performance reasons.
    */
   public function tablePrefix($table = 'default') {
-    if (isset($this->prefixes[$table])) {
-      return $this->prefixes[$table];
+    if (isset($this->_prefixes[$table])) {
+      return $this->_prefixes[$table];
     }
     else {
-      return $this->defaultPrefix;
+      return $this->_defaultPrefix;
     }
   }
 
@@ -451,8 +451,8 @@ abstract class DatabaseConnection extend
    *   logging entirely.
    */
   public function setTarget($target = NULL) {
-    if (!isset($this->target)) {
-      $this->target = $target;
+    if (!isset($this->_target)) {
+      $this->_target = $target;
     }
   }
 
@@ -463,7 +463,7 @@ abstract class DatabaseConnection extend
    *   The target string of this connection.
    */
   public function getTarget() {
-    return $this->target;
+    return $this->_target;
   }
 
   /**
@@ -473,7 +473,7 @@ abstract class DatabaseConnection extend
    *   The logging object we want to use.
    */
   public function setLogger(DatabaseLog $logger) {
-    $this->logger = $logger;
+    $this->_logger = $logger;
   }
 
   /**
@@ -484,7 +484,7 @@ abstract class DatabaseConnection extend
    *   NULL is returned.
    */
   public function getLogger() {
-    return $this->logger;
+    return $this->_logger;
   }
 
   /**
@@ -649,13 +649,13 @@ abstract class DatabaseConnection extend
    *   The name of the class that should be used for this driver.
    */
   public function getDriverClass($class) {
-    if (empty($this->driverClasses[$class])) {
-      $this->driverClasses[$class] = $class . '_' . $this->driver();
-      if (!class_exists($this->driverClasses[$class])) {
-        $this->driverClasses[$class] = $class;
+    if (empty($this->_driverClasses[$class])) {
+      $this->_driverClasses[$class] = $class . '_' . $this->driver();
+      if (!class_exists($this->_driverClasses[$class])) {
+        $this->_driverClasses[$class] = $class;
       }
     }
-    return $this->driverClasses[$class];
+    return $this->_driverClasses[$class];
   }
 
   /**
@@ -772,13 +772,13 @@ abstract class DatabaseConnection extend
    *   The DatabaseSchema object for this connection.
    */
   public function schema() {
-    if (empty($this->schema)) {
+    if (empty($this->_schema)) {
       $class = $this->getDriverClass('DatabaseSchema');
       if (class_exists($class)) {
-        $this->schema = new $class($this);
+        $this->_schema = new $class($this);
       }
     }
-    return $this->schema;
+    return $this->_schema;
   }
 
   /**
@@ -852,7 +852,7 @@ abstract class DatabaseConnection extend
    * Determines current transaction depth.
    */
   public function transactionDepth() {
-    return count($this->transactionLayers);
+    return count($this->_transactionLayers);
   }
 
   /**
@@ -890,18 +890,18 @@ abstract class DatabaseConnection extend
     }
     // A previous rollback to an earlier savepoint may mean that the savepoint
     // in question has already been rolled back.
-    if (!in_array($savepoint_name, $this->transactionLayers)) {
+    if (!in_array($savepoint_name, $this->_transactionLayers)) {
       return;
     }
 
     // We need to find the point we're rolling back to, all other savepoints
     // before are no longer needed.
-    while ($savepoint = array_pop($this->transactionLayers)) {
+    while ($savepoint = array_pop($this->_transactionLayers)) {
       if ($savepoint == $savepoint_name) {
         // If it is the last the transaction in the stack, then it is not a
         // savepoint, it is the transaction itself so we will need to roll back
         // the transaction rather than a savepoint.
-        if (empty($this->transactionLayers)) {
+        if (empty($this->_transactionLayers)) {
           break;
         }
         $this->query('ROLLBACK TO SAVEPOINT ' . $savepoint);
@@ -924,7 +924,7 @@ abstract class DatabaseConnection extend
     if (!$this->supportsTransactions()) {
       return;
     }
-    if (isset($this->transactionLayers[$name])) {
+    if (isset($this->_transactionLayers[$name])) {
       throw new DatabaseTransactionNameNonUniqueException($name . " is already in use.");
     }
     // If we're already in a transaction then we want to create a savepoint
@@ -935,7 +935,7 @@ abstract class DatabaseConnection extend
     else {
       parent::beginTransaction();
     }
-    $this->transactionLayers[$name] = $name;
+    $this->_transactionLayers[$name] = $name;
   }
 
   /**
@@ -962,11 +962,11 @@ abstract class DatabaseConnection extend
     }
 
     // Commit everything since SAVEPOINT $name.
-    while($savepoint = array_pop($this->transactionLayers)) {
+    while($savepoint = array_pop($this->_transactionLayers)) {
       if ($savepoint != $name) continue;
 
       // If there are no more layers left then we should commit.
-      if (empty($this->transactionLayers)) {
+      if (empty($this->_transactionLayers)) {
         if (!parent::commit()) {
           throw new DatabaseTransactionCommitFailedException();
         }
@@ -1010,7 +1010,7 @@ abstract class DatabaseConnection extend
    *   A table name.
    */
   protected function generateTemporaryTableName() {
-    return "db_temporary_" . $this->temporaryNameIndex++;
+    return "db_temporary_" . $this->_temporaryNameIndex++;
   }
 
   /**
@@ -1060,7 +1060,7 @@ abstract class DatabaseConnection extend
    *   TRUE if this connection supports transactions, FALSE otherwise.
    */
   public function supportsTransactions() {
-    return $this->transactionSupport;
+    return $this->_transactionSupport;
   }
 
   /**
@@ -1073,7 +1073,7 @@ abstract class DatabaseConnection extend
    *   otherwise.
    */
   public function supportsTransactionalDDL() {
-    return $this->transactionalDDLSupport;
+    return $this->_transactionalDDLSupport;
   }
 
   /**
@@ -1174,28 +1174,28 @@ abstract class Database {
    *
    * @var array
    */
-  static protected $connections = array();
+  static public $_connections = array();
 
   /**
    * A processed copy of the database connection information from settings.php.
    *
    * @var array
    */
-  static protected $databaseInfo = NULL;
+  static public $_databaseInfo = NULL;
 
   /**
    * A list of key/target credentials to simply ignore.
    *
    * @var array
    */
-  static protected $ignoreTargets = array();
+  static public $_ignoreTargets = array();
 
   /**
    * The key of the currently active database connection.
    *
    * @var string
    */
-  static protected $activeKey = 'default';
+  static public $_activeKey = 'default';
 
   /**
    * An array of active query log objects.
@@ -1209,7 +1209,7 @@ abstract class Database {
    *
    * @var array
    */
-  static protected $logs = array();
+  static public $_logs = array();
 
   /**
    * Starts logging a given logging key on the specified connection.
@@ -1227,20 +1227,20 @@ abstract class Database {
    * @see DatabaseLog
    */
   final public static function startLog($logging_key, $key = 'default') {
-    if (empty(self::$logs[$key])) {
-      self::$logs[$key] = new DatabaseLog($key);
+    if (empty(self::$_logs[$key])) {
+      self::$_logs[$key] = new DatabaseLog($key);
 
       // Every target already active for this connection key needs to have the
       // logging object associated with it.
-      if (!empty(self::$connections[$key])) {
-        foreach (self::$connections[$key] as $connection) {
-          $connection->setLogger(self::$logs[$key]);
+      if (!empty(self::$_connections[$key])) {
+        foreach (self::$_connections[$key] as $connection) {
+          $connection->setLogger(self::$_logs[$key]);
         }
       }
     }
 
-    self::$logs[$key]->start($logging_key);
-    return self::$logs[$key];
+    self::$_logs[$key]->start($logging_key);
+    return self::$_logs[$key];
   }
 
   /**
@@ -1262,11 +1262,11 @@ abstract class Database {
    * @see DatabaseLog
    */
   final public static function getLog($logging_key, $key = 'default') {
-    if (empty(self::$logs[$key])) {
+    if (empty(self::$_logs[$key])) {
       return NULL;
     }
-    $queries = self::$logs[$key]->get($logging_key);
-    self::$logs[$key]->end($logging_key);
+    $queries = self::$_logs[$key]->get($logging_key);
+    self::$_logs[$key]->end($logging_key);
     return $queries;
   }
 
@@ -1284,22 +1284,22 @@ abstract class Database {
   final public static function getConnection($target = 'default', $key = NULL) {
     if (!isset($key)) {
       // By default, we want the active connection, set in setActiveConnection.
-      $key = self::$activeKey;
+      $key = self::$_activeKey;
     }
     // If the requested target does not exist, or if it is ignored, we fall back
     // to the default target. The target is typically either "default" or
     // "slave", indicating to use a slave SQL server if one is available. If
     // it's not available, then the default/master server is the correct server
     // to use.
-    if (!empty(self::$ignoreTargets[$key][$target]) || !isset(self::$databaseInfo[$key][$target])) {
+    if (!empty(self::$_ignoreTargets[$key][$target]) || !isset(self::$_databaseInfo[$key][$target])) {
       $target = 'default';
     }
 
-    if (!isset(self::$connections[$key][$target])) {
+    if (!isset(self::$_connections[$key][$target])) {
       // If necessary, a new connection is opened.
-      self::$connections[$key][$target] = self::openConnection($key, $target);
+      self::$_connections[$key][$target] = self::openConnection($key, $target);
     }
-    return self::$connections[$key][$target];
+    return self::$_connections[$key][$target];
   }
 
   /**
@@ -1313,7 +1313,7 @@ abstract class Database {
    *   otherwise.
    */
   final public static function isActiveConnection() {
-    return !empty(self::$activeKey) && !empty(self::$connections) && !empty(self::$connections[self::$activeKey]);
+    return !empty(self::$_activeKey) && !empty(self::$_connections) && !empty(self::$_connections[self::$_activeKey]);
   }
 
   /**
@@ -1323,13 +1323,13 @@ abstract class Database {
    *   The previous database connection key.
    */
   final public static function setActiveConnection($key = 'default') {
-    if (empty(self::$databaseInfo)) {
+    if (empty(self::$_databaseInfo)) {
       self::parseConnectionInfo();
     }
 
-    if (!empty(self::$databaseInfo[$key])) {
-      $old_key = self::$activeKey;
-      self::$activeKey = $key;
+    if (!empty(self::$_databaseInfo[$key])) {
+      $old_key = self::$_activeKey;
+      self::$_activeKey = $key;
       return $old_key;
     }
   }
@@ -1366,8 +1366,8 @@ abstract class Database {
       }
     }
 
-    if (!is_array(self::$databaseInfo)) {
-      self::$databaseInfo = $database_info;
+    if (!is_array(self::$_databaseInfo)) {
+      self::$_databaseInfo = $database_info;
     }
 
     // Merge the new $database_info into the existing.
@@ -1376,7 +1376,7 @@ abstract class Database {
     else {
       foreach ($database_info as $database_key => $database_values) {
         foreach ($database_values as $target => $target_values) {
-          self::$databaseInfo[$database_key][$target] = $target_values;
+          self::$_databaseInfo[$database_key][$target] = $target_values;
         }
       }
     }
@@ -1403,8 +1403,8 @@ abstract class Database {
    *   database driver it is connecting to.
    */
   public static function addConnectionInfo($key, $target, $info) {
-    if (empty(self::$databaseInfo[$key][$target])) {
-      self::$databaseInfo[$key][$target] = $info;
+    if (empty(self::$_databaseInfo[$key][$target])) {
+      self::$_databaseInfo[$key][$target] = $info;
     }
   }
 
@@ -1415,12 +1415,12 @@ abstract class Database {
    *   The connection key for which we want information.
    */
   final public static function getConnectionInfo($key = 'default') {
-    if (empty(self::$databaseInfo)) {
+    if (empty(self::$_databaseInfo)) {
       self::parseConnectionInfo();
     }
 
-    if (!empty(self::$databaseInfo[$key])) {
-      return self::$databaseInfo[$key];
+    if (!empty(self::$_databaseInfo[$key])) {
+      return self::$_databaseInfo[$key];
     }
   }
 
@@ -1435,19 +1435,19 @@ abstract class Database {
    *   TRUE in case of success, FALSE otherwise.
    */
   final public static function renameConnection($old_key, $new_key) {
-    if (empty(self::$databaseInfo)) {
+    if (empty(self::$_databaseInfo)) {
       self::parseConnectionInfo();
     }
 
-    if (!empty(self::$databaseInfo[$old_key]) && empty(self::$databaseInfo[$new_key])) {
+    if (!empty(self::$_databaseInfo[$old_key]) && empty(self::$_databaseInfo[$new_key])) {
       // Migrate the database connection information.
-      self::$databaseInfo[$new_key] = self::$databaseInfo[$old_key];
-      unset(self::$databaseInfo[$old_key]);
+      self::$_databaseInfo[$new_key] = self::$_databaseInfo[$old_key];
+      unset(self::$_databaseInfo[$old_key]);
 
       // Migrate over the DatabaseConnection object if it exists.
-      if (isset(self::$connections[$old_key])) {
-        self::$connections[$new_key] = self::$connections[$old_key];
-        unset(self::$connections[$old_key]);
+      if (isset(self::$_connections[$old_key])) {
+        self::$_connections[$new_key] = self::$_connections[$old_key];
+        unset(self::$_connections[$old_key]);
       }
 
       return TRUE;
@@ -1466,9 +1466,9 @@ abstract class Database {
    *   TRUE in case of success, FALSE otherwise.
    */
   final public static function removeConnection($key) {
-    if (isset(self::$databaseInfo[$key])) {
-      unset(self::$databaseInfo[$key]);
-      unset(self::$connections[$key]);
+    if (isset(self::$_databaseInfo[$key])) {
+      unset(self::$_databaseInfo[$key]);
+      unset(self::$_connections[$key]);
       return TRUE;
     }
     else {
@@ -1489,17 +1489,17 @@ abstract class Database {
    * @throws DatabaseDriverNotSpecifiedException
    */
   final protected static function openConnection($key, $target) {
-    if (empty(self::$databaseInfo)) {
+    if (empty(self::$_databaseInfo)) {
       self::parseConnectionInfo();
     }
 
     // If the requested database does not exist then it is an unrecoverable
     // error.
-    if (!isset(self::$databaseInfo[$key])) {
+    if (!isset(self::$_databaseInfo[$key])) {
       throw new DatabaseConnectionNotDefinedException('The specified database connection is not defined: ' . $key);
     }
 
-    if (!$driver = self::$databaseInfo[$key][$target]['driver']) {
+    if (!$driver = self::$_databaseInfo[$key][$target]['driver']) {
       throw new DatabaseDriverNotSpecifiedException('Driver not specified for this database connection: ' . $key);
     }
 
@@ -1507,13 +1507,13 @@ abstract class Database {
     // open database connection.
     $driver_class = 'DatabaseConnection_' . $driver;
     require_once DRUPAL_ROOT . '/includes/database/' . $driver . '/database.inc';
-    $new_connection = new $driver_class(self::$databaseInfo[$key][$target]);
+    $new_connection = new $driver_class(self::$_databaseInfo[$key][$target]);
     $new_connection->setTarget($target);
 
     // If we have any active logging objects for this connection key, we need
     // to associate them with the connection we just opened.
-    if (!empty(self::$logs[$key])) {
-      $new_connection->setLogger(self::$logs[$key]);
+    if (!empty(self::$_logs[$key])) {
+      $new_connection->setLogger(self::$_logs[$key]);
     }
 
     return $new_connection;
@@ -1531,14 +1531,14 @@ abstract class Database {
   public static function closeConnection($target = NULL, $key = NULL) {
     // Gets the active connection by default.
     if (!isset($key)) {
-      $key = self::$activeKey;
+      $key = self::$_activeKey;
     }
     // To close the connection, we need to unset the static variable.
     if (isset($target)) {
-      unset(self::$connections[$key][$target]);
+      unset(self::$_connections[$key][$target]);
     }
     else {
-      unset(self::$connections[$key]);
+      unset(self::$_connections[$key]);
     }
   }
 
@@ -1555,7 +1555,7 @@ abstract class Database {
    *   The target of the specified key to ignore.
    */
   public static function ignoreTarget($key, $target) {
-    self::$ignoreTargets[$key][$target] = TRUE;
+    self::$_ignoreTargets[$key][$target] = TRUE;
   }
 
 }
@@ -1641,14 +1641,14 @@ class DatabaseTransaction {
    *
    * @var DatabaseConnection
    */
-  protected $connection;
+  public $_connection;
 
   /**
    * A boolean value to indicate whether this transaction has been rolled back.
    *
    * @var Boolean
    */
-  protected $rolledBack = FALSE;
+  public $_rolledBack = FALSE;
 
   /**
    * The name of the transaction.
@@ -1659,7 +1659,7 @@ class DatabaseTransaction {
   protected $name;
 
   public function __construct(DatabaseConnection &$connection, $name = NULL) {
-    $this->connection = &$connection;
+    $this->_connection = &$connection;
     // If there is no transaction depth, then no transaction has started. Name
     // the transaction 'drupal_transaction'.
     if (!$depth = $connection->transactionDepth()) {
@@ -1673,13 +1673,13 @@ class DatabaseTransaction {
     else {
       $this->name = $name;
     }
-    $this->connection->pushTransaction($this->name);
+    $this->_connection->pushTransaction($this->name);
   }
 
   public function __destruct() {
     // If we rolled back then the transaction would have already been popped.
-    if ($this->connection->inTransaction() && !$this->rolledBack) {
-      $this->connection->popTransaction($this->name);
+    if ($this->_connection->inTransaction() && !$this->_rolledBack) {
+      $this->_connection->popTransaction($this->name);
     }
   }
 
@@ -1703,8 +1703,8 @@ class DatabaseTransaction {
    * @see watchdog_exception()
    */
   public function rollback() {
-    $this->rolledBack = TRUE;
-    $this->connection->rollback($this->name);
+    $this->_rolledBack = TRUE;
+    $this->_connection->rollback($this->name);
   }
 }
 
@@ -1955,7 +1955,7 @@ class DatabaseStatementBase extends PDOS
   }
 
   public function getQueryString() {
-    return $this->queryString;
+    return $this->_queryString;
   }
 
   public function fetchCol($index = 0) {

=== modified file 'includes/database/log.inc'
--- includes/database/log.inc	2010-03-31 15:09:21 +0000
+++ includes/database/log.inc	2010-08-25 00:30:51 +0000
@@ -33,14 +33,14 @@ class DatabaseLog {
    *
    * @var array
    */
-  protected $queryLog = array();
+  public $_queryLog = array();
 
   /**
    * The connection key for which this object is logging.
    *
    * @var string
    */
-  protected $connectionKey = 'default';
+  public $_connectionKey = 'default';
 
   /**
    * Constructor.
@@ -49,7 +49,7 @@ class DatabaseLog {
    *   The database connection key for which to enable logging.
    */
   public function __construct($key = 'default') {
-    $this->connectionKey = $key;
+    $this->_connectionKey = $key;
   }
 
   /**
@@ -63,7 +63,7 @@ class DatabaseLog {
    *   simultaneously without them colliding.
    */
   public function start($logging_key) {
-    if (empty($this->queryLog[$logging_key])) {
+    if (empty($this->_queryLog[$logging_key])) {
       $this->clear($logging_key);
     }
   }
@@ -77,7 +77,7 @@ class DatabaseLog {
    *   An indexed array of all query records for this logging key.
    */
   public function get($logging_key) {
-    return $this->queryLog[$logging_key];
+    return $this->_queryLog[$logging_key];
   }
 
   /**
@@ -90,7 +90,7 @@ class DatabaseLog {
    *   The logging key to empty.
    */
   public function clear($logging_key) {
-    $this->queryLog[$logging_key] = array();
+    $this->_queryLog[$logging_key] = array();
   }
 
   /**
@@ -100,7 +100,7 @@ class DatabaseLog {
    *   The logging key to stop.
    */
   public function end($logging_key) {
-    unset($this->queryLog[$logging_key]);
+    unset($this->_queryLog[$logging_key]);
   }
 
   /**
@@ -114,8 +114,8 @@ class DatabaseLog {
    *   The time in milliseconds the query took to execute.
    */
   public function log(DatabaseStatementInterface $statement, $args, $time) {
-    foreach (array_keys($this->queryLog) as $key) {
-      $this->queryLog[$key][] = array(
+    foreach (array_keys($this->_queryLog) as $key) {
+      $this->_queryLog[$key][] = array(
         'query' => $statement->getQueryString(),
         'args' => $args,
         'target' => $statement->dbh->getTarget(),

=== modified file 'includes/database/mysql/database.inc'
--- includes/database/mysql/database.inc	2010-08-11 02:17:39 +0000
+++ includes/database/mysql/database.inc	2010-08-25 00:30:51 +0000
@@ -18,16 +18,16 @@ class DatabaseConnection_mysql extends D
    *
    * @var boolean
    */
-  protected $shutdownRegistered = FALSE;
+  public $_shutdownRegistered = FALSE;
 
   public function __construct(array $connection_options = array()) {
     // This driver defaults to transaction support, except if explicitly passed FALSE.
-    $this->transactionSupport = !isset($connection_options['transactions']) || ($connection_options['transactions'] !== FALSE);
+    $this->_transactionSupport = !isset($connection_options['transactions']) || ($connection_options['transactions'] !== FALSE);
 
     // MySQL never supports transactional DDL.
-    $this->transactionalDDLSupport = FALSE;
+    $this->_transactionalDDLSupport = FALSE;
 
-    $this->connectionOptions = $connection_options;
+    $this->_connectionOptions = $connection_options;
 
     // The DSN should use either a socket or a host/port.
     if (isset($connection_options['unix_socket'])) {
@@ -107,7 +107,7 @@ class DatabaseConnection_mysql extends D
       $this->query('INSERT INTO {sequences} (value) VALUES (:value) ON DUPLICATE KEY UPDATE value = value', array(':value' => $existing_id));
       $new_id = $this->query('INSERT INTO {sequences} () VALUES ()', array(), array('return' => Database::RETURN_INSERT_ID));
     }
-    if (!$this->shutdownRegistered) {
+    if (!$this->_shutdownRegistered) {
       // Use register_shutdown_function() here to keep the database system
       // independent of Drupal.
       register_shutdown_function(array($this, 'nextIdDelete'));
@@ -131,7 +131,7 @@ class DatabaseConnection_mysql extends D
       $this->query('DELETE FROM {sequences} WHERE value < :value', array(':value' => $max_id));
     }
     // During testing, this function is called from shutdown with the
-    // simpletest prefix stored in $this->connection, and those tables are gone
+    // simpletest prefix stored in $this->_connection, and those tables are gone
     // by the time shutdown is called so we need to ignore the database
     // errors. There is no problem with completely ignoring errors here: if
     // these queries fail, the sequence will work just fine, just use a bit

=== modified file 'includes/database/mysql/install.inc'
--- includes/database/mysql/install.inc	2010-07-30 01:59:14 +0000
+++ includes/database/mysql/install.inc	2010-08-25 00:30:51 +0000
@@ -16,7 +16,7 @@ class DatabaseTasks_mysql extends Databa
    *
    * @var string
    */
-  protected $pdoDriver = 'mysql';
+  public $_pdoDriver = 'mysql';
 
   /**
    * Returns a human-readable name string for MySQL and equivalent databases.

=== modified file 'includes/database/mysql/query.inc'
--- includes/database/mysql/query.inc	2010-06-26 01:40:05 +0000
+++ includes/database/mysql/query.inc	2010-08-25 00:30:51 +0000
@@ -21,51 +21,51 @@ class InsertQuery_mysql extends InsertQu
 
     // If we're selecting from a SelectQuery, finish building the query and
     // pass it back, as any remaining options are irrelevant.
-    if (empty($this->fromQuery)) {
+    if (empty($this->_fromQuery)) {
       $max_placeholder = 0;
       $values = array();
-      foreach ($this->insertValues as $insert_values) {
+      foreach ($this->_insertValues as $insert_values) {
         foreach ($insert_values as $value) {
           $values[':db_insert_placeholder_' . $max_placeholder++] = $value;
         }
       }
     }
     else {
-      $values = $this->fromQuery->getArguments();
+      $values = $this->_fromQuery->getArguments();
     }
 
-    $last_insert_id = $this->connection->query((string) $this, $values, $this->queryOptions);
+    $last_insert_id = $this->_connection->query((string) $this, $values, $this->_queryOptions);
 
     // Re-initialize the values array so that we can re-use this query.
-    $this->insertValues = array();
+    $this->_insertValues = array();
 
     return $last_insert_id;
   }
 
   public function __toString() {
     // Create a comments string to prepend to the query.
-    $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : '';
+    $comments = (!empty($this->_comments)) ? '/* ' . implode('; ', $this->_comments) . ' */ ' : '';
 
     // Default fields are always placed first for consistency.
-    $insert_fields = array_merge($this->defaultFields, $this->insertFields);
+    $insert_fields = array_merge($this->_defaultFields, $this->_insertFields);
 
     // If we're selecting from a SelectQuery, finish building the query and
     // pass it back, as any remaining options are irrelevant.
-    if (!empty($this->fromQuery)) {
-      return $comments . 'INSERT INTO {' . $this->table . '} (' . implode(', ', $insert_fields) . ') ' . $this->fromQuery;
+    if (!empty($this->_fromQuery)) {
+      return $comments . 'INSERT INTO {' . $this->_table . '} (' . implode(', ', $insert_fields) . ') ' . $this->_fromQuery;
     }
 
-    $query = $comments . 'INSERT INTO {' . $this->table . '} (' . implode(', ', $insert_fields) . ') VALUES ';
+    $query = $comments . 'INSERT INTO {' . $this->_table . '} (' . implode(', ', $insert_fields) . ') VALUES ';
 
     $max_placeholder = 0;
     $values = array();
-    if (count($this->insertValues)) {
-      foreach ($this->insertValues as $insert_values) {
+    if (count($this->_insertValues)) {
+      foreach ($this->_insertValues as $insert_values) {
         $placeholders = array();
 
         // Default fields aren't really placeholders, but this is the most convenient
         // way to handle them.
-        $placeholders = array_pad($placeholders, count($this->defaultFields), 'default');
+        $placeholders = array_pad($placeholders, count($this->_defaultFields), 'default');
 
         $new_placeholder = $max_placeholder + count($insert_values);
         for ($i = $max_placeholder; $i < $new_placeholder; ++$i) {
@@ -77,7 +77,7 @@ class InsertQuery_mysql extends InsertQu
     }
     else {
       // If there are no values, then this is a default-only query. We still need to handle that.
-      $placeholders = array_fill(0, count($this->defaultFields), 'default');
+      $placeholders = array_fill(0, count($this->_defaultFields), 'default');
       $values[] = '(' . implode(', ', $placeholders) . ')';
     }
 
@@ -92,10 +92,10 @@ class TruncateQuery_mysql extends Trunca
     // TRUNCATE is actually a DDL statement on MySQL, and DDL statements are
     // not transactional, and result in an implicit COMMIT. When we are in a
     // transaction, fallback to the slower, but transactional, DELETE.
-    if ($this->connection->inTransaction()) {
+    if ($this->_connection->inTransaction()) {
       // Create a comments string to prepend to the query.
-      $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : '';
-      return $comments . 'DELETE FROM {' . $this->connection->escapeTable($this->table) . '}';
+      $comments = (!empty($this->_comments)) ? '/* ' . implode('; ', $this->_comments) . ' */ ' : '';
+      return $comments . 'DELETE FROM {' . $this->_connection->escapeTable($this->_table) . '}';
     }
     else {
       return parent::__toString();

=== modified file 'includes/database/mysql/schema.inc'
--- includes/database/mysql/schema.inc	2010-08-02 18:55:17 +0000
+++ includes/database/mysql/schema.inc	2010-08-25 00:30:51 +0000
@@ -31,7 +31,7 @@ class DatabaseSchema_mysql extends Datab
    *   A keyed array with information about the database, table name and prefix.
    */
   protected function getPrefixInfo($table = 'default', $add_prefix = TRUE) {
-    $info = array('prefix' => $this->connection->tablePrefix($table));
+    $info = array('prefix' => $this->_connection->tablePrefix($table));
     if ($add_prefix) {
       $table = $info['prefix'] . $table;
     }
@@ -56,7 +56,7 @@ class DatabaseSchema_mysql extends Datab
    * from the condition criteria.
    */
   protected function buildTableNameCondition($table_name, $operator = '=', $add_prefix = TRUE) {
-    $info = $this->connection->getConnectionOptions();
+    $info = $this->_connection->getConnectionOptions();
 
     $table_info = $this->getPrefixInfo($table_name, $add_prefix);
 
@@ -77,7 +77,7 @@ class DatabaseSchema_mysql extends Datab
    *   An array of SQL statements to create the table.
    */
   protected function createTableSql($name, $table) {
-    $info = $this->connection->getConnectionOptions();
+    $info = $this->_connection->getConnectionOptions();
 
     // Provide defaults if needed.
     $table += array(
@@ -295,7 +295,7 @@ class DatabaseSchema_mysql extends Datab
     }
 
     $info = $this->getPrefixInfo($new_name);
-    return $this->connection->query('ALTER TABLE {' . $table . '} RENAME TO `' . $info['table'] . '`');
+    return $this->_connection->query('ALTER TABLE {' . $table . '} RENAME TO `' . $info['table'] . '`');
   }
 
   public function dropTable($table) {
@@ -303,7 +303,7 @@ class DatabaseSchema_mysql extends Datab
       return FALSE;
     }
 
-    $this->connection->query('DROP TABLE {' . $table . '}');
+    $this->_connection->query('DROP TABLE {' . $table . '}');
     return TRUE;
   }
 
@@ -325,9 +325,9 @@ class DatabaseSchema_mysql extends Datab
     if ($keys_sql = $this->createKeysSql($keys_new)) {
       $query .= ', ADD ' . implode(', ADD ', $keys_sql);
     }
-    $this->connection->query($query);
+    $this->_connection->query($query);
     if (isset($spec['initial'])) {
-      $this->connection->update($table)
+      $this->_connection->update($table)
         ->fields(array($field, $spec['initial']))
         ->execute();
     }
@@ -342,7 +342,7 @@ class DatabaseSchema_mysql extends Datab
       return FALSE;
     }
 
-    $this->connection->query('ALTER TABLE {' . $table . '} DROP `' . $field . '`');
+    $this->_connection->query('ALTER TABLE {' . $table . '} DROP `' . $field . '`');
     return TRUE;
   }
 
@@ -358,7 +358,7 @@ class DatabaseSchema_mysql extends Datab
       $default = is_string($default) ? "'$default'" : $default;
     }
 
-    $this->connection->query('ALTER TABLE {' . $table . '} ALTER COLUMN `' . $field . '` SET DEFAULT ' . $default);
+    $this->_connection->query('ALTER TABLE {' . $table . '} ALTER COLUMN `' . $field . '` SET DEFAULT ' . $default);
   }
 
   public function fieldSetNoDefault($table, $field) {
@@ -366,13 +366,13 @@ class DatabaseSchema_mysql extends Datab
       throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot remove default value of field %table.%field: field doesn't exist.", array('%table' => $table, '%field' => $field)));
     }
 
-    $this->connection->query('ALTER TABLE {' . $table . '} ALTER COLUMN `' . $field . '` DROP DEFAULT');
+    $this->_connection->query('ALTER TABLE {' . $table . '} ALTER COLUMN `' . $field . '` DROP DEFAULT');
   }
 
   public function indexExists($table, $name) {
     // Returns one row for each column in the index. Result is string or FALSE.
     // Details at http://dev.mysql.com/doc/refman/5.0/en/show-index.html
-    $row = $this->connection->query('SHOW INDEX FROM {' . $table . "} WHERE key_name = '$name'")->fetchAssoc();
+    $row = $this->_connection->query('SHOW INDEX FROM {' . $table . "} WHERE key_name = '$name'")->fetchAssoc();
     return isset($row['key_name']);
   }
 
@@ -384,7 +384,7 @@ class DatabaseSchema_mysql extends Datab
       throw new DatabaseSchemaObjectExistsException(t("Cannot add primary key to table %table: primary key already exists.", array('%table' => $table)));
     }
 
-    $this->connection->query('ALTER TABLE {' . $table . '} ADD PRIMARY KEY (' . $this->createKeySql($fields) . ')');
+    $this->_connection->query('ALTER TABLE {' . $table . '} ADD PRIMARY KEY (' . $this->createKeySql($fields) . ')');
   }
 
   public function dropPrimaryKey($table) {
@@ -392,7 +392,7 @@ class DatabaseSchema_mysql extends Datab
       return FALSE;
     }
 
-    $this->connection->query('ALTER TABLE {' . $table . '} DROP PRIMARY KEY');
+    $this->_connection->query('ALTER TABLE {' . $table . '} DROP PRIMARY KEY');
     return TRUE;
   }
 
@@ -404,7 +404,7 @@ class DatabaseSchema_mysql extends Datab
       throw new DatabaseSchemaObjectExistsException(t("Cannot add unique key %name to table %table: unique key already exists.", array('%table' => $table, '%name' => $name)));
     }
 
-    $this->connection->query('ALTER TABLE {' . $table . '} ADD UNIQUE KEY `' . $name . '` (' . $this->createKeySql($fields) . ')');
+    $this->_connection->query('ALTER TABLE {' . $table . '} ADD UNIQUE KEY `' . $name . '` (' . $this->createKeySql($fields) . ')');
   }
 
   public function dropUniqueKey($table, $name) {
@@ -412,7 +412,7 @@ class DatabaseSchema_mysql extends Datab
       return FALSE;
     }
 
-    $this->connection->query('ALTER TABLE {' . $table . '} DROP KEY `' . $name . '`');
+    $this->_connection->query('ALTER TABLE {' . $table . '} DROP KEY `' . $name . '`');
     return TRUE;
   }
 
@@ -424,7 +424,7 @@ class DatabaseSchema_mysql extends Datab
       throw new DatabaseSchemaObjectExistsException(t("Cannot add index %name to table %table: index already exists.", array('%table' => $table, '%name' => $name)));
     }
 
-    $this->connection->query('ALTER TABLE {' . $table . '} ADD INDEX `' . $name . '` (' . $this->createKeySql($fields) . ')');
+    $this->_connection->query('ALTER TABLE {' . $table . '} ADD INDEX `' . $name . '` (' . $this->createKeySql($fields) . ')');
   }
 
   public function dropIndex($table, $name) {
@@ -432,7 +432,7 @@ class DatabaseSchema_mysql extends Datab
       return FALSE;
     }
 
-    $this->connection->query('ALTER TABLE {' . $table . '} DROP INDEX `' . $name . '`');
+    $this->_connection->query('ALTER TABLE {' . $table . '} DROP INDEX `' . $name . '`');
     return TRUE;
   }
 
@@ -448,7 +448,7 @@ class DatabaseSchema_mysql extends Datab
     if ($keys_sql = $this->createKeysSql($keys_new)) {
       $sql .= ', ADD ' . implode(', ADD ', $keys_sql);
     }
-    $this->connection->query($sql);
+    $this->_connection->query($sql);
   }
 
   public function prepareComment($comment, $length = NULL) {
@@ -458,10 +458,10 @@ class DatabaseSchema_mysql extends Datab
     // Truncate comment to maximum comment length.
     if (isset($length)) {
       // Add table prefixes before truncating.
-      $comment = truncate_utf8($this->connection->prefixTables($comment), $length, TRUE, TRUE);
+      $comment = truncate_utf8($this->_connection->prefixTables($comment), $length, TRUE, TRUE);
     }
 
-    return $this->connection->quote($comment);
+    return $this->_connection->quote($comment);
   }
 
   /**
@@ -471,13 +471,13 @@ class DatabaseSchema_mysql extends Datab
     $condition = $this->buildTableNameCondition($table);
     if (isset($column)) {
       $condition->condition('column_name', $column);
-      $condition->compile($this->connection, $this);
+      $condition->compile($this->_connection, $this);
       // Don't use {} around information_schema.columns table.
-      return $this->connection->query("SELECT column_comment FROM information_schema.columns WHERE " . (string) $condition, $condition->arguments())->fetchField();
+      return $this->_connection->query("SELECT column_comment FROM information_schema.columns WHERE " . (string) $condition, $condition->arguments())->fetchField();
     }
-    $condition->compile($this->connection, $this);
+    $condition->compile($this->_connection, $this);
     // Don't use {} around information_schema.tables table.
-    $comment = $this->connection->query("SELECT table_comment FROM information_schema.tables WHERE " . (string) $condition, $condition->arguments())->fetchField();
+    $comment = $this->_connection->query("SELECT table_comment FROM information_schema.tables WHERE " . (string) $condition, $condition->arguments())->fetchField();
     // Work-around for MySQL 5.0 bug http://bugs.mysql.com/bug.php?id=11379
     return preg_replace('/; InnoDB free:.*$/', '', $comment);
   }
@@ -491,7 +491,7 @@ class DatabaseSchema_mysql extends Datab
     // @todo: This override should be removed once we require a version of MySQL
     // that has that bug fixed.
     try {
-      $this->connection->queryRange("SELECT 1 FROM {" . $table . "}", 0, 1);
+      $this->_connection->queryRange("SELECT 1 FROM {" . $table . "}", 0, 1);
       return TRUE;
     }
     catch (Exception $e) {
@@ -508,7 +508,7 @@ class DatabaseSchema_mysql extends Datab
     // @todo: This override should be removed once we require a version of MySQL
     // that has that bug fixed.
     try {
-      $this->connection->queryRange("SELECT $column FROM {" . $table . "}", 0, 1);
+      $this->_connection->queryRange("SELECT $column FROM {" . $table . "}", 0, 1);
       return TRUE;
     }
     catch (Exception $e) {

=== modified file 'includes/database/pgsql/database.inc'
--- includes/database/pgsql/database.inc	2010-08-11 02:17:39 +0000
+++ includes/database/pgsql/database.inc	2010-08-25 00:30:51 +0000
@@ -20,11 +20,11 @@ class DatabaseConnection_pgsql extends D
 
   public function __construct(array $connection_options = array()) {
     // This driver defaults to transaction support, except if explicitly passed FALSE.
-    $this->transactionSupport = !isset($connection_options['transactions']) || ($connection_options['transactions'] !== FALSE);
+    $this->_transactionSupport = !isset($connection_options['transactions']) || ($connection_options['transactions'] !== FALSE);
 
     // Transactional DDL is always available in PostgreSQL,
     // but we'll only enable it if standard transactions are.
-    $this->transactionalDDLSupport = $this->transactionSupport;
+    $this->_transactionalDDLSupport = $this->_transactionSupport;
 
     // Default to TCP connection on port 5432.
     if (empty($connection_options['port'])) {
@@ -36,7 +36,7 @@ class DatabaseConnection_pgsql extends D
       $connection_options['password'] = NULL;
     }
 
-    $this->connectionOptions = $connection_options;
+    $this->_connectionOptions = $connection_options;
 
     $dsn = 'pgsql:host=' . $connection_options['host'] . ' dbname=' . $connection_options['database'] . ' port=' . $connection_options['port'];
     parent::__construct($dsn, $connection_options['username'], $connection_options['password'], array(

=== modified file 'includes/database/pgsql/install.inc'
--- includes/database/pgsql/install.inc	2010-08-16 21:01:23 +0000
+++ includes/database/pgsql/install.inc	2010-08-25 00:30:51 +0000
@@ -10,18 +10,18 @@
 // PostgreSQL specific install functions
 
 class DatabaseTasks_pgsql extends DatabaseTasks {
-  protected $pdoDriver = 'pgsql';
+  public $_pdoDriver = 'pgsql';
 
   public function __construct() {
-    $this->tasks[] = array(
+    $this->_tasks[] = array(
       'function' => 'checkEncoding',
       'arguments' => array(),
     );
-    $this->tasks[] = array(
+    $this->_tasks[] = array(
       'function' => 'checkPHPVersion',
       'arguments' => array(),
     );
-    $this->tasks[] = array(
+    $this->_tasks[] = array(
       'function' => 'initializeDatabase',
       'arguments' => array(),
     );

=== modified file 'includes/database/pgsql/query.inc'
--- includes/database/pgsql/query.inc	2010-07-19 22:11:04 +0000
+++ includes/database/pgsql/query.inc	2010-08-25 00:30:51 +0000
@@ -19,16 +19,16 @@ class InsertQuery_pgsql extends InsertQu
       return NULL;
     }
 
-    $stmt = $this->connection->prepareQuery((string) $this);
+    $stmt = $this->_connection->prepareQuery((string) $this);
 
     // Fetch the list of blobs and sequences used on that table.
-    $table_information = $this->connection->schema()->queryTableInformation($this->table);
+    $table_information = $this->_connection->schema()->queryTableInformation($this->_table);
 
     $max_placeholder = 0;
     $blobs = array();
     $blob_count = 0;
-    foreach ($this->insertValues as $insert_values) {
-      foreach ($this->insertFields as $idx => $field) {
+    foreach ($this->_insertValues as $insert_values) {
+      foreach ($this->_insertFields as $idx => $field) {
         if (isset($table_information->blob_fields[$field])) {
           $blobs[$blob_count] = fopen('php://memory', 'a');
           fwrite($blobs[$blob_count], $insert_values[$idx]);
@@ -44,12 +44,12 @@ class InsertQuery_pgsql extends InsertQu
         }
       }
     }
-    if (!empty($this->fromQuery)) {
+    if (!empty($this->_fromQuery)) {
       // bindParam stores only a reference to the variable that is followed when
       // the statement is executed. We pass $arguments[$key] instead of $value
       // because the second argument to bindParam is passed by reference and
       // the foreach statement assigns the element to the existing reference.
-      $arguments = $this->fromQuery->getArguments();
+      $arguments = $this->_fromQuery->getArguments();
       foreach ($arguments as $key => $value) {
         $stmt->bindParam($key, $arguments[$key]);
       }
@@ -58,7 +58,7 @@ class InsertQuery_pgsql extends InsertQu
     // PostgreSQL requires the table name to be specified explicitly
     // when requesting the last insert ID, so we pass that in via
     // the options array.
-    $options = $this->queryOptions;
+    $options = $this->_queryOptions;
 
     if (!empty($table_information->sequences)) {
       $options['sequence_name'] = $table_information->sequences[0];
@@ -67,38 +67,38 @@ class InsertQuery_pgsql extends InsertQu
     elseif ($options['return'] == Database::RETURN_INSERT_ID) {
       $options['return'] = Database::RETURN_NULL;
     }
-    $last_insert_id = $this->connection->query($stmt, array(), $options);
+    $last_insert_id = $this->_connection->query($stmt, array(), $options);
 
     // Re-initialize the values array so that we can re-use this query.
-    $this->insertValues = array();
+    $this->_insertValues = array();
 
     return $last_insert_id;
   }
 
   public function __toString() {
     // Create a comments string to prepend to the query.
-    $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : '';
+    $comments = (!empty($this->_comments)) ? '/* ' . implode('; ', $this->_comments) . ' */ ' : '';
 
     // Default fields are always placed first for consistency.
-    $insert_fields = array_merge($this->defaultFields, $this->insertFields);
+    $insert_fields = array_merge($this->_defaultFields, $this->_insertFields);
 
     // If we're selecting from a SelectQuery, finish building the query and
     // pass it back, as any remaining options are irrelevant.
-    if (!empty($this->fromQuery)) {
-      return $comments . 'INSERT INTO {' . $this->table . '} (' . implode(', ', $insert_fields) . ') ' . $this->fromQuery;
+    if (!empty($this->_fromQuery)) {
+      return $comments . 'INSERT INTO {' . $this->_table . '} (' . implode(', ', $insert_fields) . ') ' . $this->_fromQuery;
     }
 
-    $query = $comments . 'INSERT INTO {' . $this->table . '} (' . implode(', ', $insert_fields) . ') VALUES ';
+    $query = $comments . 'INSERT INTO {' . $this->_table . '} (' . implode(', ', $insert_fields) . ') VALUES ';
 
     $max_placeholder = 0;
     $values = array();
-      if (count($this->insertValues)) {
-      foreach ($this->insertValues as $insert_values) {
+      if (count($this->_insertValues)) {
+      foreach ($this->_insertValues as $insert_values) {
         $placeholders = array();
 
         // Default fields aren't really placeholders, but this is the most convenient
         // way to handle them.
-        $placeholders = array_pad($placeholders, count($this->defaultFields), 'default');
+        $placeholders = array_pad($placeholders, count($this->_defaultFields), 'default');
 
         $new_placeholder = $max_placeholder + count($insert_values);
         for ($i = $max_placeholder; $i < $new_placeholder; ++$i) {
@@ -110,7 +110,7 @@ class InsertQuery_pgsql extends InsertQu
     }
     else {
       // If there are no values, then this is a default-only query. We still need to handle that.
-      $placeholders = array_fill(0, count($this->defaultFields), 'default');
+      $placeholders = array_fill(0, count($this->_defaultFields), 'default');
       $values[] = '(' . implode(', ', $placeholders) . ')';
     }
 
@@ -128,16 +128,16 @@ class UpdateQuery_pgsql extends UpdateQu
 
     // Because we filter $fields the same way here and in __toString(), the
     // placeholders will all match up properly.
-    $stmt = $this->connection->prepareQuery((string) $this);
+    $stmt = $this->_connection->prepareQuery((string) $this);
 
     // Fetch the list of blobs and sequences used on that table.
-    $table_information = $this->connection->schema()->queryTableInformation($this->table);
+    $table_information = $this->_connection->schema()->queryTableInformation($this->_table);
 
     // Expressions take priority over literal fields, so we process those first
     // and remove any literal fields that conflict.
-    $fields = $this->fields;
+    $fields = $this->_fields;
     $expression_fields = array();
-    foreach ($this->expressionFields as $field => $data) {
+    foreach ($this->_expressionFields as $field => $data) {
       if (!empty($data['arguments'])) {
         foreach ($data['arguments'] as $placeholder => $argument) {
           // We assume that an expression will never happen on a BLOB field,
@@ -164,18 +164,18 @@ class UpdateQuery_pgsql extends UpdateQu
       }
     }
 
-    if (count($this->condition)) {
-      $this->condition->compile($this->connection, $this);
+    if (count($this->_condition)) {
+      $this->_condition->compile($this->_connection, $this);
 
-      $arguments = $this->condition->arguments();
+      $arguments = $this->_condition->arguments();
       foreach ($arguments as $placeholder => $value) {
         $stmt->bindParam($placeholder, $arguments[$placeholder]);
       }
     }
 
-    $options = $this->queryOptions;
+    $options = $this->_queryOptions;
     $options['already_prepared'] = TRUE;
-    $this->connection->query($stmt, $options);
+    $this->_connection->query($stmt, $options);
 
     return $stmt->rowCount();
   }

=== modified file 'includes/database/pgsql/schema.inc'
--- includes/database/pgsql/schema.inc	2010-07-28 10:52:12 +0000
+++ includes/database/pgsql/schema.inc	2010-08-25 00:30:51 +0000
@@ -22,7 +22,7 @@ class DatabaseSchema_pgsql extends Datab
    * @see DatabaseConnection_pgsql->queryTableInformation()
    * @var array
    */
-  protected $tableInformation = array();
+  public $_tableInformation = array();
 
   /**
    * Fetch the list of blobs and sequences used on a table.
@@ -39,12 +39,12 @@ class DatabaseSchema_pgsql extends Datab
    */
   public function queryTableInformation($table) {
     // Generate a key to reference this table's information on.
-    $key = $this->connection->prefixTables('{' . $table . '}');
+    $key = $this->_connection->prefixTables('{' . $table . '}');
     if (!strpos($key, '.')) {
       $key = 'public.' . $key;
     }
 
-    if (!isset($this->tableInformation[$key])) {
+    if (!isset($this->_tableInformation[$key])) {
       // Split the key into schema and table for querying.
       list($schema, $table_name) = explode('.', $key);
       $table_information = (object) array(
@@ -52,7 +52,7 @@ class DatabaseSchema_pgsql extends Datab
         'sequences' => array(),
       );
       // Don't use {} around information_schema.columns table.
-      $result = $this->connection->query("SELECT column_name, data_type, column_default FROM information_schema.columns WHERE table_schema = :schema AND table_name = :table AND (data_type = 'bytea' OR (numeric_precision IS NOT NULL AND column_default LIKE :default))", array(
+      $result = $this->_connection->query("SELECT column_name, data_type, column_default FROM information_schema.columns WHERE table_schema = :schema AND table_name = :table AND (data_type = 'bytea' OR (numeric_precision IS NOT NULL AND column_default LIKE :default))", array(
         ':schema' => $schema,
         ':table' => $table_name,
         ':default' => '%nextval%',
@@ -68,9 +68,9 @@ class DatabaseSchema_pgsql extends Datab
           $table_information->sequences[] = $matches[1];
         }
       }
-      $this->tableInformation[$key] = $table_information;
+      $this->_tableInformation[$key] = $table_information;
     }
-    return $this->tableInformation[$key];
+    return $this->_tableInformation[$key];
   }
 
   /**
@@ -277,23 +277,23 @@ class DatabaseSchema_pgsql extends Datab
     }
 
     // Get the schema and tablename for the old table.
-    $old_full_name = $this->connection->prefixTables('{' . $table . '}');
+    $old_full_name = $this->_connection->prefixTables('{' . $table . '}');
     list($old_schema, $old_table_name) = strpos($old_full_name, '.') ? explode('.', $old_full_name) : array('public', $old_full_name);
 
     // Index names and constraint names are global in PostgreSQL, so we need to
     // rename them when renaming the table.
-    $indexes = $this->connection->query('SELECT indexname FROM pg_indexes WHERE schemaname = :schema AND tablename = :table', array(':schema' => $old_schema, ':table' => $old_table_name));
+    $indexes = $this->_connection->query('SELECT indexname FROM pg_indexes WHERE schemaname = :schema AND tablename = :table', array(':schema' => $old_schema, ':table' => $old_table_name));
     foreach ($indexes as $index) {
       if (preg_match('/^' . preg_quote($old_full_name) . '_(.*)_idx$/', $index->indexname, $matches)) {
         $index_name = $matches[1];
-        $this->connection->query('ALTER INDEX ' . $index->indexname . ' RENAME TO {' . $new_name . '}_' . $index_name . '_idx');
+        $this->_connection->query('ALTER INDEX ' . $index->indexname . ' RENAME TO {' . $new_name . '}_' . $index_name . '_idx');
       }
     }
 
     // Now rename the table.
     // Ensure the new table name does not include schema syntax.
     $prefixInfo = $this->getPrefixInfo($new_name);
-    $this->connection->query('ALTER TABLE {' . $table . '} RENAME TO ' . $prefixInfo['table']);
+    $this->_connection->query('ALTER TABLE {' . $table . '} RENAME TO ' . $prefixInfo['table']);
   }
 
   public function dropTable($table) {
@@ -301,7 +301,7 @@ class DatabaseSchema_pgsql extends Datab
       return FALSE;
     }
 
-    $this->connection->query('DROP TABLE {' . $table . '}');
+    $this->_connection->query('DROP TABLE {' . $table . '}');
     return TRUE;
   }
 
@@ -320,21 +320,21 @@ class DatabaseSchema_pgsql extends Datab
     }
     $query = 'ALTER TABLE {' . $table . '} ADD COLUMN ';
     $query .= $this->createFieldSql($field, $this->processField($spec));
-    $this->connection->query($query);
+    $this->_connection->query($query);
     if (isset($spec['initial'])) {
-      $this->connection->update($table)
+      $this->_connection->update($table)
         ->fields(array($field, $spec['initial']))
         ->execute();
     }
     if ($fixnull) {
-      $this->connection->query("ALTER TABLE {" . $table . "} ALTER $field SET NOT NULL");
+      $this->_connection->query("ALTER TABLE {" . $table . "} ALTER $field SET NOT NULL");
     }
     if (isset($new_keys)) {
       $this->_createKeys($table, $new_keys);
     }
     // Add column comment.
     if (!empty($spec['description'])) {
-      $this->connection->query('COMMENT ON COLUMN {' . $table . '}.' . $field . ' IS ' . $this->prepareComment($spec['description']));
+      $this->_connection->query('COMMENT ON COLUMN {' . $table . '}.' . $field . ' IS ' . $this->prepareComment($spec['description']));
     }
   }
 
@@ -343,7 +343,7 @@ class DatabaseSchema_pgsql extends Datab
       return FALSE;
     }
 
-    $this->connection->query('ALTER TABLE {' . $table . '} DROP COLUMN "' . $field . '"');
+    $this->_connection->query('ALTER TABLE {' . $table . '} DROP COLUMN "' . $field . '"');
     return TRUE;
   }
 
@@ -359,7 +359,7 @@ class DatabaseSchema_pgsql extends Datab
       $default = is_string($default) ? "'$default'" : $default;
     }
 
-    $this->connection->query('ALTER TABLE {' . $table . '} ALTER COLUMN "' . $field . '" SET DEFAULT ' . $default);
+    $this->_connection->query('ALTER TABLE {' . $table . '} ALTER COLUMN "' . $field . '" SET DEFAULT ' . $default);
   }
 
   public function fieldSetNoDefault($table, $field) {
@@ -367,13 +367,13 @@ class DatabaseSchema_pgsql extends Datab
       throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot remove default value of field %table.%field: field doesn't exist.", array('%table' => $table, '%field' => $field)));
     }
 
-    $this->connection->query('ALTER TABLE {' . $table . '} ALTER COLUMN "' . $field . '" DROP DEFAULT');
+    $this->_connection->query('ALTER TABLE {' . $table . '} ALTER COLUMN "' . $field . '" DROP DEFAULT');
   }
 
   public function indexExists($table, $name) {
     // Details http://www.postgresql.org/docs/8.3/interactive/view-pg-indexes.html
     $index_name = '{' . $table . '}_' . $name . '_idx';
-    return (bool) $this->connection->query("SELECT 1 FROM pg_indexes WHERE indexname = '$index_name'")->fetchField();
+    return (bool) $this->_connection->query("SELECT 1 FROM pg_indexes WHERE indexname = '$index_name'")->fetchField();
   }
 
   /**
@@ -386,7 +386,7 @@ class DatabaseSchema_pgsql extends Datab
    */
   protected function constraintExists($table, $name) {
     $constraint_name = '{' . $table . '}_' . $name;
-    return (bool) $this->connection->query("SELECT 1 FROM pg_constraint WHERE conname = '$constraint_name'")->fetchField();
+    return (bool) $this->_connection->query("SELECT 1 FROM pg_constraint WHERE conname = '$constraint_name'")->fetchField();
   }
 
   public function addPrimaryKey($table, $fields) {
@@ -397,7 +397,7 @@ class DatabaseSchema_pgsql extends Datab
       throw new DatabaseSchemaObjectExistsException(t("Cannot add primary key to table %table: primary key already exists.", array('%table' => $table)));
     }
 
-    $this->connection->query('ALTER TABLE {' . $table . '} ADD PRIMARY KEY (' . implode(',', $fields) . ')');
+    $this->_connection->query('ALTER TABLE {' . $table . '} ADD PRIMARY KEY (' . implode(',', $fields) . ')');
   }
 
   public function dropPrimaryKey($table) {
@@ -405,7 +405,7 @@ class DatabaseSchema_pgsql extends Datab
       return FALSE;
     }
 
-    $this->connection->query('ALTER TABLE {' . $table . '} DROP CONSTRAINT ' . $this->prefixNonTable($table, 'pkey'));
+    $this->_connection->query('ALTER TABLE {' . $table . '} DROP CONSTRAINT ' . $this->prefixNonTable($table, 'pkey'));
     return TRUE;
   }
 
@@ -417,7 +417,7 @@ class DatabaseSchema_pgsql extends Datab
       throw new DatabaseSchemaObjectExistsException(t("Cannot add unique key %name to table %table: unique key already exists.", array('%table' => $table, '%name' => $name)));
     }
 
-    $this->connection->query('ALTER TABLE {' . $table . '} ADD CONSTRAINT "' . $this->prefixNonTable($table, $name, 'key') . '" UNIQUE (' . implode(',', $fields) . ')');
+    $this->_connection->query('ALTER TABLE {' . $table . '} ADD CONSTRAINT "' . $this->prefixNonTable($table, $name, 'key') . '" UNIQUE (' . implode(',', $fields) . ')');
   }
 
   public function dropUniqueKey($table, $name) {
@@ -425,7 +425,7 @@ class DatabaseSchema_pgsql extends Datab
       return FALSE;
     }
 
-    $this->connection->query('ALTER TABLE {' . $table . '} DROP CONSTRAINT "' . $this->prefixNonTable($table, $name, 'key') . '"');
+    $this->_connection->query('ALTER TABLE {' . $table . '} DROP CONSTRAINT "' . $this->prefixNonTable($table, $name, 'key') . '"');
     return TRUE;
   }
 
@@ -437,7 +437,7 @@ class DatabaseSchema_pgsql extends Datab
       throw new DatabaseSchemaObjectExistsException(t("Cannot add index %name to table %table: index already exists.", array('%table' => $table, '%name' => $name)));
     }
 
-    $this->connection->query($this->_createIndexSql($table, $name, $fields));
+    $this->_connection->query($this->_createIndexSql($table, $name, $fields));
   }
 
   public function dropIndex($table, $name) {
@@ -445,7 +445,7 @@ class DatabaseSchema_pgsql extends Datab
       return FALSE;
     }
 
-    $this->connection->query('DROP INDEX ' . $this->prefixNonTable($table, $name, 'idx'));
+    $this->_connection->query('DROP INDEX ' . $this->prefixNonTable($table, $name, 'idx'));
     return TRUE;
   }
 
@@ -471,7 +471,7 @@ class DatabaseSchema_pgsql extends Datab
     }
 
 
-    $this->connection->query("ALTER TABLE {" . $table . "} ALTER $field SET $field_new = CAST(" . $field . "_old as " . $typecast . ")");
+    $this->_connection->query("ALTER TABLE {" . $table . "} ALTER $field SET $field_new = CAST(" . $field . "_old as " . $typecast . ")");
 
     $this->addField($table, "$field_new", $spec);
 
@@ -479,7 +479,7 @@ class DatabaseSchema_pgsql extends Datab
 
     // Rename the column if necessary.
     if ($field != $field_new) {
-      $this->connection->query('ALTER TABLE {' . $table . '} RENAME "' . $field . '" TO "' . $field_new . '_old"');
+      $this->_connection->query('ALTER TABLE {' . $table . '} RENAME "' . $field . '" TO "' . $field_new . '_old"');
     }
 
     if (isset($new_keys)) {
@@ -516,10 +516,10 @@ class DatabaseSchema_pgsql extends Datab
     $info = $this->getPrefixInfo($table);
     // Don't use {} around pg_class, pg_attribute tables.
     if (isset($column)) {
-      return $this->connection->query('SELECT col_description(oid, attnum) FROM pg_class, pg_attribute WHERE attrelid = oid AND relname = ? AND attname = ?', array($info['table'], $column))->fetchField();
+      return $this->_connection->query('SELECT col_description(oid, attnum) FROM pg_class, pg_attribute WHERE attrelid = oid AND relname = ? AND attname = ?', array($info['table'], $column))->fetchField();
     }
     else {
-      return $this->connection->query('SELECT obj_description(oid, ?) FROM pg_class WHERE relname = ?', array('pg_class', $info['table']))->fetchField();
+      return $this->_connection->query('SELECT obj_description(oid, ?) FROM pg_class WHERE relname = ?', array('pg_class', $info['table']))->fetchField();
     }
   }
 }

=== modified file 'includes/database/prefetch.inc'
--- includes/database/prefetch.inc	2010-04-30 13:47:46 +0000
+++ includes/database/prefetch.inc	2010-08-25 00:30:51 +0000
@@ -27,14 +27,14 @@ class DatabaseStatementPrefetch implemen
    *
    * @var string
    */
-  protected $queryString;
+  public $_queryString;
 
   /**
    * Driver-specific options. Can be used by child classes.
    *
    * @var Array
    */
-  protected $driverOptions;
+  public $_driverOptions;
 
   /**
    * Reference to the database connection object for this statement.
@@ -50,42 +50,42 @@ class DatabaseStatementPrefetch implemen
    *
    * @var Array
    */
-  protected $data = array();
+  public $_data = array();
 
   /**
    * The current row, retrieved in PDO::FETCH_ASSOC format.
    *
    * @var Array
    */
-  protected $currentRow = NULL;
+  public $_currentRow = NULL;
 
   /**
    * The key of the current row.
    *
    * @var int
    */
-  protected $currentKey = NULL;
+  public $_currentKey = NULL;
 
   /**
    * The list of column names in this result set.
    *
    * @var Array
    */
-  protected $columnNames = NULL;
+  public $_columnNames = NULL;
 
   /**
    * The number of rows affected by the last query.
    *
    * @var int
    */
-  protected $rowCount = NULL;
+  public $_rowCount = NULL;
 
   /**
    * The number of rows in this result set.
    *
    * @var int
    */
-  protected $resultRowCount = 0;
+  public $_resultRowCount = 0;
 
   /**
    * Holds the current fetch style (which will be used by the next fetch).
@@ -93,14 +93,14 @@ class DatabaseStatementPrefetch implemen
    *
    * @var int
    */
-  protected $fetchStyle = PDO::FETCH_OBJ;
+  public $_fetchStyle = PDO::FETCH_OBJ;
 
   /**
    * Holds supplementary current fetch options (which will be used by the next fetch).
    *
    * @var Array
    */
-  protected $fetchOptions = array(
+  public $_fetchOptions = array(
     'class' => 'stdClass',
     'constructor_args' => array(),
     'object' => NULL,
@@ -112,14 +112,14 @@ class DatabaseStatementPrefetch implemen
    *
    * @var int
    */
-  protected $defaultFetchStyle = PDO::FETCH_OBJ;
+  public $_defaultFetchStyle = PDO::FETCH_OBJ;
 
   /**
    * Holds supplementary default fetch options.
    *
    * @var Array
    */
-  protected $defaultFetchOptions = array(
+  public $_defaultFetchOptions = array(
     'class' => 'stdClass',
     'constructor_args' => array(),
     'object' => NULL,
@@ -128,8 +128,8 @@ class DatabaseStatementPrefetch implemen
 
   public function __construct(DatabaseConnection $connection, $query, array $driver_options = array()) {
     $this->dbh = $connection;
-    $this->queryString = $query;
-    $this->driverOptions = $driver_options;
+    $this->_queryString = $query;
+    $this->_driverOptions = $driver_options;
   }
 
   /**
@@ -161,7 +161,7 @@ class DatabaseStatementPrefetch implemen
     }
 
     // Prepare the query.
-    $statement = $this->getStatement($this->queryString, $args);
+    $statement = $this->getStatement($this->_queryString, $args);
     if (!$statement) {
       $this->throwPDOException();
     }
@@ -173,19 +173,19 @@ class DatabaseStatementPrefetch implemen
 
     // Fetch all the data from the reply, in order to release any lock
     // as soon as possible.
-    $this->rowCount = $statement->rowCount();
-    $this->data = $statement->fetchAll(PDO::FETCH_ASSOC);
+    $this->_rowCount = $statement->rowCount();
+    $this->_data = $statement->fetchAll(PDO::FETCH_ASSOC);
     // Destroy the statement as soon as possible. See
     // DatabaseConnection_sqlite::PDOPrepare() for explanation.
     unset($statement);
 
-    $this->resultRowCount = count($this->data);
+    $this->_resultRowCount = count($this->_data);
 
-    if ($this->resultRowCount) {
-      $this->columnNames = array_keys($this->data[0]);
+    if ($this->_resultRowCount) {
+      $this->_columnNames = array_keys($this->_data[0]);
     }
     else {
-      $this->columnNames = array();
+      $this->_columnNames = array();
     }
 
     if (!empty($logger)) {
@@ -193,7 +193,7 @@ class DatabaseStatementPrefetch implemen
       $logger->log($this, $args, $query_end - $query_start);
     }
 
-    // Initialize the first row in $this->currentRow.
+    // Initialize the first row in $this->_currentRow.
     $this->next();
 
     return $return;
@@ -231,86 +231,86 @@ class DatabaseStatementPrefetch implemen
    * Return the object's SQL query string.
    */
   public function getQueryString() {
-    return $this->queryString;
+    return $this->_queryString;
   }
 
   /**
    * @see PDOStatement::setFetchMode()
    */
   public function setFetchMode($fetchStyle, $a2 = NULL, $a3 = NULL) {
-    $this->defaultFetchStyle = $fetchStyle;
+    $this->_defaultFetchStyle = $fetchStyle;
     switch ($fetchStyle) {
       case PDO::FETCH_CLASS:
-        $this->defaultFetchOptions['class'] = $a2;
+        $this->_defaultFetchOptions['class'] = $a2;
         if ($a3) {
-          $this->defaultFetchOptions['constructor_args'] = $a3;
+          $this->_defaultFetchOptions['constructor_args'] = $a3;
         }
         break;
       case PDO::FETCH_COLUMN:
-        $this->defaultFetchOptions['column'] = $a2;
+        $this->_defaultFetchOptions['column'] = $a2;
         break;
       case PDO::FETCH_INTO:
-        $this->defaultFetchOptions['object'] = $a2;
+        $this->_defaultFetchOptions['object'] = $a2;
         break;
     }
 
     // Set the values for the next fetch.
-    $this->fetchStyle = $this->defaultFetchStyle;
-    $this->fetchOptions = $this->defaultFetchOptions;
+    $this->_fetchStyle = $this->_defaultFetchStyle;
+    $this->_fetchOptions = $this->_defaultFetchOptions;
   }
 
   /**
    * Return the current row formatted according to the current fetch style.
    *
    * This is the core method of this class. It grabs the value at the current
-   * array position in $this->data and format it according to $this->fetchStyle
+   * array position in $this->_data and format it according to $this->_fetchStyle
    * and $this->fetchMode.
    *
    * @return
    *  The current row formatted as requested.
    */
   public function current() {
-    if (isset($this->currentRow)) {
-      switch ($this->fetchStyle) {
+    if (isset($this->_currentRow)) {
+      switch ($this->_fetchStyle) {
         case PDO::FETCH_ASSOC:
-          return $this->currentRow;
+          return $this->_currentRow;
         case PDO::FETCH_BOTH:
           // PDO::FETCH_BOTH returns an array indexed by both the column name
           // and the column number.
-          return $this->currentRow + array_values($this->currentRow);
+          return $this->_currentRow + array_values($this->_currentRow);
         case PDO::FETCH_NUM:
-          return array_values($this->currentRow);
+          return array_values($this->_currentRow);
         case PDO::FETCH_LAZY:
           // We do not do lazy as everything is fetched already. Fallback to
           // PDO::FETCH_OBJ.
         case PDO::FETCH_OBJ:
-          return (object) $this->currentRow;
+          return (object) $this->_currentRow;
         case PDO::FETCH_CLASS | PDO::FETCH_CLASSTYPE:
-          $class_name = array_unshift($this->currentRow);
+          $class_name = array_unshift($this->_currentRow);
           // Deliberate no break.
         case PDO::FETCH_CLASS:
           if (!isset($class_name)) {
-            $class_name = $this->fetchOptions['class'];
+            $class_name = $this->_fetchOptions['class'];
           }
-          if (count($this->fetchOptions['constructor_args'])) {
+          if (count($this->_fetchOptions['constructor_args'])) {
             $reflector = new ReflectionClass($class_name);
-            $result = $reflector->newInstanceArgs($this->fetchOptions['constructor_args']);
+            $result = $reflector->newInstanceArgs($this->_fetchOptions['constructor_args']);
           }
           else {
             $result = new $class_name();
           }
-          foreach ($this->currentRow as $k => $v) {
+          foreach ($this->_currentRow as $k => $v) {
             $result->$k = $v;
           }
           return $result;
         case PDO::FETCH_INTO:
-          foreach ($this->currentRow as $k => $v) {
-            $this->fetchOptions['object']->$k = $v;
+          foreach ($this->_currentRow as $k => $v) {
+            $this->_fetchOptions['object']->$k = $v;
           }
-          return $this->fetchOptions['object'];
+          return $this->_fetchOptions['object'];
         case PDO::FETCH_COLUMN:
-          if (isset($this->columnNames[$this->fetchOptions['column']])) {
-            return $this->currentRow[$k][$this->columnNames[$this->fetchOptions['column']]];
+          if (isset($this->_columnNames[$this->_fetchOptions['column']])) {
+            return $this->_currentRow[$k][$this->_columnNames[$this->_fetchOptions['column']]];
           }
           else {
             return;
@@ -322,7 +322,7 @@ class DatabaseStatementPrefetch implemen
   /* Implementations of Iterator. */
 
   public function key() {
-    return $this->currentKey;
+    return $this->_currentKey;
   }
 
   public function rewind() {
@@ -330,31 +330,31 @@ class DatabaseStatementPrefetch implemen
   }
 
   public function next() {
-    if (!empty($this->data)) {
-      $this->currentRow = reset($this->data);
-      $this->currentKey = key($this->data);
-      unset($this->data[$this->currentKey]);
+    if (!empty($this->_data)) {
+      $this->_currentRow = reset($this->_data);
+      $this->_currentKey = key($this->_data);
+      unset($this->_data[$this->_currentKey]);
     }
     else {
-      $this->currentRow = NULL;
+      $this->_currentRow = NULL;
     }
   }
 
   public function valid() {
-    return isset($this->currentRow);
+    return isset($this->_currentRow);
   }
 
   /* Implementations of DatabaseStatementInterface. */
 
   public function rowCount() {
-    return $this->rowCount;
+    return $this->_rowCount;
   }
 
   public function fetch($fetch_style = NULL, $cursor_orientation = PDO::FETCH_ORI_NEXT, $cursor_offset = NULL) {
-    if (isset($this->currentRow)) {
+    if (isset($this->_currentRow)) {
       // Set the fetch parameter.
-      $this->fetchStyle = isset($fetch_style) ? $fetch_style : $this->defaultFetchStyle;
-      $this->fetchOptions = $this->defaultFetchOptions;
+      $this->_fetchStyle = isset($fetch_style) ? $fetch_style : $this->_defaultFetchStyle;
+      $this->_fetchOptions = $this->_defaultFetchOptions;
 
       // Grab the row in the format specified above.
       $return = $this->current();
@@ -362,8 +362,8 @@ class DatabaseStatementPrefetch implemen
       $this->next();
 
       // Reset the fetch parameters to the value stored using setFetchMode().
-      $this->fetchStyle = $this->defaultFetchStyle;
-      $this->fetchOptions = $this->defaultFetchOptions;
+      $this->_fetchStyle = $this->_defaultFetchStyle;
+      $this->_fetchOptions = $this->_defaultFetchOptions;
       return $return;
     }
     else {
@@ -372,9 +372,9 @@ class DatabaseStatementPrefetch implemen
   }
 
   public function fetchField($index = 0) {
-    if (isset($this->currentRow) && isset($this->columnNames[$index])) {
-      // We grab the value directly from $this->data, and format it.
-      $return = $this->currentRow[$this->columnNames[$index]];
+    if (isset($this->_currentRow) && isset($this->_columnNames[$index])) {
+      // We grab the value directly from $this->_data, and format it.
+      $return = $this->_currentRow[$this->_columnNames[$index]];
       $this->next();
       return $return;
     }
@@ -384,19 +384,19 @@ class DatabaseStatementPrefetch implemen
   }
 
   public function fetchObject($class_name = NULL, $constructor_args = array()) {
-    if (isset($this->currentRow)) {
+    if (isset($this->_currentRow)) {
       if (!isset($class_name)) {
         // Directly cast to an object to avoid a function call.
-        $result = (object) $this->currentRow;
+        $result = (object) $this->_currentRow;
       }
       else {
-        $this->fetchStyle = PDO::FETCH_CLASS;
-        $this->fetchOptions = array('constructor_args' => $constructor_args);
+        $this->_fetchStyle = PDO::FETCH_CLASS;
+        $this->_fetchOptions = array('constructor_args' => $constructor_args);
         // Grab the row in the format specified above.
         $result = $this->current();
         // Reset the fetch parameters to the value stored using setFetchMode().
-        $this->fetchStyle = $this->defaultFetchStyle;
-        $this->fetchOptions = $this->defaultFetchOptions;
+        $this->_fetchStyle = $this->_defaultFetchStyle;
+        $this->_fetchOptions = $this->_defaultFetchOptions;
       }
 
       $this->next();
@@ -409,8 +409,8 @@ class DatabaseStatementPrefetch implemen
   }
 
   public function fetchAssoc() {
-    if (isset($this->currentRow)) {
-      $result = $this->currentRow;
+    if (isset($this->_currentRow)) {
+      $result = $this->_currentRow;
       $this->next();
       return $result;
     }
@@ -420,36 +420,36 @@ class DatabaseStatementPrefetch implemen
   }
 
   public function fetchAll($fetch_style = NULL, $fetch_column = NULL, $constructor_args = NULL) {
-    $this->fetchStyle = isset($fetch_style) ? $fetch_style : $this->defaultFetchStyle;
-    $this->fetchOptions = $this->defaultFetchOptions;
+    $this->_fetchStyle = isset($fetch_style) ? $fetch_style : $this->_defaultFetchStyle;
+    $this->_fetchOptions = $this->_defaultFetchOptions;
     if (isset($fetch_column)) {
-      $this->fetchOptions['column'] = $fetch_column;
+      $this->_fetchOptions['column'] = $fetch_column;
     }
     if (isset($constructor_args)) {
-      $this->fetchOptions['constructor_args'] = $constructor_args;
+      $this->_fetchOptions['constructor_args'] = $constructor_args;
     }
 
     $result = array();
     // Traverse the array as PHP would have done.
-    while (isset($this->currentRow)) {
+    while (isset($this->_currentRow)) {
       // Grab the row in the format specified above.
       $result[] = $this->current();
       $this->next();
     }
 
     // Reset the fetch parameters to the value stored using setFetchMode().
-    $this->fetchStyle = $this->defaultFetchStyle;
-    $this->fetchOptions = $this->defaultFetchOptions;
+    $this->_fetchStyle = $this->_defaultFetchStyle;
+    $this->_fetchOptions = $this->_defaultFetchOptions;
     return $result;
   }
 
   public function fetchCol($index = 0) {
-    if (isset($this->columnNames[$index])) {
-      $column = $this->columnNames[$index];
+    if (isset($this->_columnNames[$index])) {
+      $column = $this->_columnNames[$index];
       $result = array();
       // Traverse the array as PHP would have done.
-      while (isset($this->currentRow)) {
-        $result[] = $this->currentRow[$this->columnNames[$index]];
+      while (isset($this->_currentRow)) {
+        $result[] = $this->_currentRow[$this->_columnNames[$index]];
         $this->next();
       }
       return $result;
@@ -460,39 +460,39 @@ class DatabaseStatementPrefetch implemen
   }
 
   public function fetchAllKeyed($key_index = 0, $value_index = 1) {
-    if (!isset($this->columnNames[$key_index]) || !isset($this->columnNames[$value_index]))
+    if (!isset($this->_columnNames[$key_index]) || !isset($this->_columnNames[$value_index]))
       return array();
 
-    $key = $this->columnNames[$key_index];
-    $value = $this->columnNames[$value_index];
+    $key = $this->_columnNames[$key_index];
+    $value = $this->_columnNames[$value_index];
 
     $result = array();
     // Traverse the array as PHP would have done.
-    while (isset($this->currentRow)) {
-      $result[$this->currentRow[$key]] = $this->currentRow[$value];
+    while (isset($this->_currentRow)) {
+      $result[$this->_currentRow[$key]] = $this->_currentRow[$value];
       $this->next();
     }
     return $result;
   }
 
   public function fetchAllAssoc($key, $fetch_style = NULL) {
-    $this->fetchStyle = isset($fetch_style) ? $fetch_style : $this->defaultFetchStyle;
-    $this->fetchOptions = $this->defaultFetchOptions;
+    $this->_fetchStyle = isset($fetch_style) ? $fetch_style : $this->_defaultFetchStyle;
+    $this->_fetchOptions = $this->_defaultFetchOptions;
 
     $result = array();
     // Traverse the array as PHP would have done.
-    while (isset($this->currentRow)) {
+    while (isset($this->_currentRow)) {
       // Grab the row in its raw PDO::FETCH_ASSOC format.
-      $row = $this->currentRow;
+      $row = $this->_currentRow;
       // Grab the row in the format specified above.
       $result_row = $this->current();
-      $result[$this->currentRow[$key]] = $result_row;
+      $result[$this->_currentRow[$key]] = $result_row;
       $this->next();
     }
 
     // Reset the fetch parameters to the value stored using setFetchMode().
-    $this->fetchStyle = $this->defaultFetchStyle;
-    $this->fetchOptions = $this->defaultFetchOptions;
+    $this->_fetchStyle = $this->_defaultFetchStyle;
+    $this->_fetchOptions = $this->_defaultFetchOptions;
     return $result;
   }
 

=== modified file 'includes/database/query.inc'
--- includes/database/query.inc	2010-08-05 08:26:35 +0000
+++ includes/database/query.inc	2010-08-25 00:30:51 +0000
@@ -226,30 +226,30 @@ abstract class Query implements QueryPla
    *
    * @var DatabaseConnection
    */
-  protected $connection;
+  public $_connection;
 
   /**
    * The query options to pass on to the connection object.
    *
    * @var array
    */
-  protected $queryOptions;
+  public $_queryOptions;
 
   /**
    * The placeholder counter.
    */
-  protected $nextPlaceholder = 0;
+  public $_nextPlaceholder = 0;
 
   /**
    * An array of comments that can be prepended to a query.
    *
    * @var array
    */
-  protected $comments = array();
+  public $_comments = array();
 
   public function __construct(DatabaseConnection $connection, $options) {
-    $this->connection = $connection;
-    $this->queryOptions = $options;
+    $this->_connection = $connection;
+    $this->_queryOptions = $options;
   }
 
   /**
@@ -268,7 +268,7 @@ abstract class Query implements QueryPla
   abstract public function __toString();
 
   public function nextPlaceholder() {
-    return $this->nextPlaceholder++;
+    return $this->_nextPlaceholder++;
   }
 
   /**
@@ -285,7 +285,7 @@ abstract class Query implements QueryPla
    *   The called object.
    */
   public function comment($comment) {
-    $this->comments[] = $comment;
+    $this->_comments[] = $comment;
     return $this;
   }
 
@@ -306,7 +306,7 @@ abstract class Query implements QueryPla
    *   A reference to the comments array structure.
    */
   public function &getComments() {
-    return $this->comments;
+    return $this->_comments;
   }
 }
 
@@ -320,21 +320,21 @@ class InsertQuery extends Query {
    *
    * @var string
    */
-  protected $table;
+  public $_table;
 
   /**
    * An array of fields on which to insert.
    *
    * @var array
    */
-  protected $insertFields = array();
+  public $_insertFields = array();
 
   /**
    * An array of fields which should be set to their database-defined defaults.
    *
    * @var array
    */
-  protected $defaultFields = array();
+  public $_defaultFields = array();
 
   /**
    * A nested array of values to insert.
@@ -347,21 +347,21 @@ class InsertQuery extends Query {
    *
    * @var string
    */
-  protected $insertValues = array();
+  public $_insertValues = array();
 
   /**
    * A SelectQuery object to fetch the rows that should be inserted.
    *
    * @var SelectQueryInterface
    */
-  protected $fromQuery;
+  public $_fromQuery;
 
   public function __construct($connection, $table, array $options = array()) {
     if (!isset($options['return'])) {
       $options['return'] = Database::RETURN_INSERT_ID;
     }
     parent::__construct($connection, $options);
-    $this->table = $table;
+    $this->_table = $table;
   }
 
   /**
@@ -384,16 +384,16 @@ class InsertQuery extends Query {
    *   The called object.
    */
   public function fields(array $fields, array $values = array()) {
-    if (empty($this->insertFields)) {
+    if (empty($this->_insertFields)) {
       if (empty($values)) {
         if (!is_numeric(key($fields))) {
           $values = array_values($fields);
           $fields = array_keys($fields);
         }
       }
-      $this->insertFields = $fields;
+      $this->_insertFields = $fields;
       if (!empty($values)) {
-        $this->insertValues[] = $values;
+        $this->_insertValues[] = $values;
       }
     }
 
@@ -415,15 +415,15 @@ class InsertQuery extends Query {
    */
   public function values(array $values) {
     if (is_numeric(key($values))) {
-      $this->insertValues[] = $values;
+      $this->_insertValues[] = $values;
     }
     else {
       // Reorder the submitted values to match the fields array.
-      foreach ($this->insertFields as $key) {
+      foreach ($this->_insertFields as $key) {
         $insert_values[$key] = $values[$key];
       }
       // For consistency, the values array is always numerically indexed.
-      $this->insertValues[] = array_values($insert_values);
+      $this->_insertValues[] = array_values($insert_values);
     }
     return $this;
   }
@@ -447,12 +447,12 @@ class InsertQuery extends Query {
    *   The called object.
    */
   public function useDefaults(array $fields) {
-    $this->defaultFields = $fields;
+    $this->_defaultFields = $fields;
     return $this;
   }
 
   public function from(SelectQueryInterface $query) {
-    $this->fromQuery = $query;
+    $this->_fromQuery = $query;
     return $this;
   }
 
@@ -474,10 +474,10 @@ class InsertQuery extends Query {
 
     // If we're selecting from a SelectQuery, finish building the query and
     // pass it back, as any remaining options are irrelevant.
-    if (!empty($this->fromQuery)) {
+    if (!empty($this->_fromQuery)) {
       $sql = (string) $this;
       // The SelectQuery may contain arguments, load and pass them through.
-      return $this->connection->query($sql, $this->fromQuery->getArguments(), $this->queryOptions);
+      return $this->_connection->query($sql, $this->_fromQuery->getArguments(), $this->_queryOptions);
     }
 
     $last_insert_id = 0;
@@ -485,12 +485,12 @@ class InsertQuery extends Query {
     // Each insert happens in its own query in the degenerate case. However,
     // we wrap it in a transaction so that it is atomic where possible. On many
     // databases, such as SQLite, this is also a notable performance boost.
-    $transaction = $this->connection->startTransaction();
+    $transaction = $this->_connection->startTransaction();
 
     try {
       $sql = (string) $this;
-      foreach ($this->insertValues as $insert_values) {
-        $last_insert_id = $this->connection->query($sql, $insert_values, $this->queryOptions);
+      foreach ($this->_insertValues as $insert_values) {
+        $last_insert_id = $this->_connection->query($sql, $insert_values, $this->_queryOptions);
       }
     }
     catch (Exception $e) {
@@ -501,7 +501,7 @@ class InsertQuery extends Query {
     }
 
     // Re-initialize the values array so that we can re-use this query.
-    $this->insertValues = array();
+    $this->_insertValues = array();
 
     // Transaction commits here where $transaction looses scope.
 
@@ -511,23 +511,23 @@ class InsertQuery extends Query {
   public function __toString() {
 
     // Create a comments string to prepend to the query.
-    $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : '';
+    $comments = (!empty($this->_comments)) ? '/* ' . implode('; ', $this->_comments) . ' */ ' : '';
 
     // Default fields are always placed first for consistency.
-    $insert_fields = array_merge($this->defaultFields, $this->insertFields);
+    $insert_fields = array_merge($this->_defaultFields, $this->_insertFields);
 
-    if (!empty($this->fromQuery)) {
-      return $comments . 'INSERT INTO {' . $this->table . '} (' . implode(', ', $insert_fields) . ') ' . $this->fromQuery;
+    if (!empty($this->_fromQuery)) {
+      return $comments . 'INSERT INTO {' . $this->_table . '} (' . implode(', ', $insert_fields) . ') ' . $this->_fromQuery;
     }
 
     // For simplicity, we will use the $placeholders array to inject
     // default keywords even though they are not, strictly speaking,
     // placeholders for prepared statements.
     $placeholders = array();
-    $placeholders = array_pad($placeholders, count($this->defaultFields), 'default');
-    $placeholders = array_pad($placeholders, count($this->insertFields), '?');
+    $placeholders = array_pad($placeholders, count($this->_defaultFields), 'default');
+    $placeholders = array_pad($placeholders, count($this->_insertFields), '?');
 
-    return $comments . 'INSERT INTO {' . $this->table . '} (' . implode(', ', $insert_fields) . ') VALUES (' . implode(', ', $placeholders) . ')';
+    return $comments . 'INSERT INTO {' . $this->_table . '} (' . implode(', ', $insert_fields) . ') VALUES (' . implode(', ', $placeholders) . ')';
   }
 
   /**
@@ -542,28 +542,28 @@ class InsertQuery extends Query {
   public function preExecute() {
     // Confirm that the user did not try to specify an identical
     // field and default field.
-    if (array_intersect($this->insertFields, $this->defaultFields)) {
+    if (array_intersect($this->_insertFields, $this->_defaultFields)) {
       throw new FieldsOverlapException('You may not specify the same field to have a value and a schema-default value.');
     }
 
-    if (!empty($this->fromQuery)) {
+    if (!empty($this->_fromQuery)) {
       // We have to assume that the used aliases match the insert fields.
       // Regular fields are added to the query before expressions, maintain the
       // same order for the insert fields.
       // This behavior can be overridden by calling fields() manually as only the
       // first call to fields() does have an effect.
-      $this->fields(array_merge(array_keys($this->fromQuery->getFields()), array_keys($this->fromQuery->getExpressions())));
+      $this->fields(array_merge(array_keys($this->_fromQuery->getFields()), array_keys($this->_fromQuery->getExpressions())));
     }
 
     // Don't execute query without fields.
-    if (count($this->insertFields) + count($this->defaultFields) == 0) {
+    if (count($this->_insertFields) + count($this->_defaultFields) == 0) {
       throw new NoFieldsException('There are no fields available to insert with.');
     }
 
     // If no values have been added, silently ignore this query. This can happen
     // if values are added conditionally, so we don't want to throw an
     // exception.
-    if (!isset($this->insertValues[0]) && count($this->insertFields) > 0 && empty($this->fromQuery)) {
+    if (!isset($this->_insertValues[0]) && count($this->_insertFields) > 0 && empty($this->_fromQuery)) {
       return FALSE;
     }
     return TRUE;
@@ -589,14 +589,14 @@ class MergeQuery extends Query {
    *
    * @var string
    */
-  protected $table;
+  public $_table;
 
   /**
    * An array of fields on which to insert.
    *
    * @var array
    */
-  protected $insertFields = array();
+  public $_insertFields = array();
 
   /**
    * An array of fields to update instead of the values specified in
@@ -604,21 +604,21 @@ class MergeQuery extends Query {
    *
    * @var array
    */
-  protected $updateFields = array();
+  public $_updateFields = array();
 
   /**
    * An array of key fields for this query.
    *
    * @var array
    */
-  protected $keyFields = array();
+  public $_keyFields = array();
 
   /**
    * An array of fields to not update in case of a duplicate record.
    *
    * @var array
    */
-  protected $excludeFields = array();
+  public $_excludeFields = array();
 
   /**
    * An array of fields to update to an expression in case of a duplicate record.
@@ -631,12 +631,12 @@ class MergeQuery extends Query {
    *
    * @var array
    */
-  protected $expressionFields = array();
+  public $_expressionFields = array();
 
   public function __construct($connection, $table, array $options = array()) {
     $options['return'] = Database::RETURN_AFFECTED;
     parent::__construct($connection, $options);
-    $this->table = $table;
+    $this->_table = $table;
   }
 
   /**
@@ -661,7 +661,7 @@ class MergeQuery extends Query {
     if (count($values) > 0) {
       $fields = array_combine($fields, $values);
     }
-    $this->insertFields = $fields;
+    $this->_insertFields = $fields;
 
     return $this;
   }
@@ -695,7 +695,7 @@ class MergeQuery extends Query {
     if ($values) {
       $fields = array_combine($fields, $values);
     }
-    $this->keyFields = $fields;
+    $this->_keyFields = $fields;
 
     return $this;
   }
@@ -719,7 +719,7 @@ class MergeQuery extends Query {
     if ($values) {
       $fields = array_combine($fields, $values);
     }
-    $this->updateFields = $fields;
+    $this->_updateFields = $fields;
 
     return $this;
   }
@@ -748,7 +748,7 @@ class MergeQuery extends Query {
     if (!is_array($exclude_fields)) {
       $exclude_fields = func_get_args();
     }
-    $this->excludeFields = $exclude_fields;
+    $this->_excludeFields = $exclude_fields;
 
     return $this;
   }
@@ -772,7 +772,7 @@ class MergeQuery extends Query {
    *   The called object.
    */
   public function expression($field, $expression, array $arguments = NULL) {
-    $this->expressionFields[$field] = array(
+    $this->_expressionFields[$field] = array(
       'expression' => $expression,
       'arguments' => $arguments,
     );
@@ -791,7 +791,7 @@ class MergeQuery extends Query {
   public function preExecute() {
 
     // A merge query without any key field is invalid.
-    if (count($this->keyFields) == 0) {
+    if (count($this->_keyFields) == 0) {
       throw new InvalidMergeQueryException("You need to specify key fields before executing a merge query");
     }
 
@@ -819,16 +819,16 @@ class MergeQuery extends Query {
     // queries as there is no universal single-query mechanism that will work.
 
     // Wrap multiple queries in a transaction, if the database supports it.
-    $transaction = $this->connection->startTransaction();
+    $transaction = $this->_connection->startTransaction();
 
     try {
       // Manually check if the record already exists.
       // We build a 'SELECT 1 FROM table WHERE conditions FOR UPDATE' query,
       // that will lock the rows that matches our set of conditions as well as
       // return the information that there are such rows.
-      $select = $this->connection->select($this->table);
+      $select = $this->_connection->select($this->_table);
       $select->addExpression('1');
-      foreach ($this->keyFields as $field => $value) {
+      foreach ($this->_keyFields as $field => $value) {
         $select->condition($field, $value);
       }
 
@@ -837,11 +837,11 @@ class MergeQuery extends Query {
       $arguments = $select->getArguments();
 
       // If there are no existing records, run an insert query.
-      if (!$this->connection->query($sql, $arguments)->fetchField()) {
+      if (!$this->_connection->query($sql, $arguments)->fetchField()) {
         // If there is no existing record, run an insert query.
-        $insert_fields = $this->insertFields + $this->keyFields;
+        $insert_fields = $this->_insertFields + $this->_keyFields;
         try {
-          $this->connection->insert($this->table, $this->queryOptions)->fields($insert_fields)->execute();
+          $this->_connection->insert($this->_table, $this->_queryOptions)->fields($insert_fields)->execute();
           return MergeQuery::STATUS_INSERT;
         }
         catch (Exception $e) {
@@ -849,30 +849,30 @@ class MergeQuery extends Query {
           // beat us in inserting the same row. Retry the select query, if it
           // returns a row, ignore the error and continue with the update
           // query below.
-          if (!$this->connection->query($sql, $arguments)->fetchField()) {
+          if (!$this->_connection->query($sql, $arguments)->fetchField()) {
             throw $e;
           }
         }
       }
 
       // Proceed with an update query if a row was found.
-      if ($this->updateFields) {
-        $update_fields = $this->updateFields;
+      if ($this->_updateFields) {
+        $update_fields = $this->_updateFields;
       }
       else {
-        $update_fields = $this->insertFields;
+        $update_fields = $this->_insertFields;
         // If there are no exclude fields, this is a no-op.
-        foreach ($this->excludeFields as $exclude_field) {
+        foreach ($this->_excludeFields as $exclude_field) {
           unset($update_fields[$exclude_field]);
         }
       }
-      if ($update_fields || $this->expressionFields) {
+      if ($update_fields || $this->_expressionFields) {
         // Only run the update if there are fields or expressions to update.
-        $update = $this->connection->update($this->table, $this->queryOptions)->fields($update_fields);
-        foreach ($this->keyFields as $field => $value) {
+        $update = $this->_connection->update($this->_table, $this->_queryOptions)->fields($update_fields);
+        foreach ($this->_keyFields as $field => $value) {
           $update->condition($field, $value);
         }
-        foreach ($this->expressionFields as $field => $expression) {
+        foreach ($this->_expressionFields as $field => $expression) {
           $update->expression($field, $expression['expression'], $expression['arguments']);
         }
         $update->execute();
@@ -906,7 +906,7 @@ class DeleteQuery extends Query implemen
    *
    * @var string
    */
-  protected $table;
+  public $_table;
 
   /**
    * The condition object for this query. Condition handling is handled via
@@ -914,69 +914,69 @@ class DeleteQuery extends Query implemen
    *
    * @var DatabaseCondition
    */
-  protected $condition;
+  public $_condition;
 
   public function __construct(DatabaseConnection $connection, $table, array $options = array()) {
     $options['return'] = Database::RETURN_AFFECTED;
     parent::__construct($connection, $options);
-    $this->table = $table;
+    $this->_table = $table;
 
-    $this->condition = new DatabaseCondition('AND');
+    $this->_condition = new DatabaseCondition('AND');
   }
 
   public function condition($field, $value = NULL, $operator = NULL) {
-    $this->condition->condition($field, $value, $operator);
+    $this->_condition->condition($field, $value, $operator);
     return $this;
   }
 
   public function isNull($field) {
-    $this->condition->isNull($field);
+    $this->_condition->isNull($field);
     return $this;
   }
 
   public function isNotNull($field) {
-    $this->condition->isNotNull($field);
+    $this->_condition->isNotNull($field);
     return $this;
   }
 
   public function &conditions() {
-    return $this->condition->conditions();
+    return $this->_condition->conditions();
   }
 
   public function arguments() {
-    return $this->condition->arguments();
+    return $this->_condition->arguments();
   }
 
   public function where($snippet, $args = array()) {
-    $this->condition->where($snippet, $args);
+    $this->_condition->where($snippet, $args);
     return $this;
   }
 
   public function compile(DatabaseConnection $connection, QueryPlaceholderInterface $queryPlaceholder = NULL) {
-    return $this->condition->compile($connection, isset($queryPlaceholder) ? $queryPlaceholder : $this);
+    return $this->_condition->compile($connection, isset($queryPlaceholder) ? $queryPlaceholder : $this);
   }
 
   public function execute() {
     $values = array();
-    if (count($this->condition)) {
-      $this->condition->compile($this->connection, $this);
-      $values = $this->condition->arguments();
+    if (count($this->_condition)) {
+      $this->_condition->compile($this->_connection, $this);
+      $values = $this->_condition->arguments();
     }
 
-    return $this->connection->query((string) $this, $values, $this->queryOptions);
+    return $this->_connection->query((string) $this, $values, $this->_queryOptions);
   }
 
   public function __toString() {
 
     // Create a comments string to prepend to the query.
-    $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : '';
+    $comments = (!empty($this->_comments)) ? '/* ' . implode('; ', $this->_comments) . ' */ ' : '';
 
-    $query = $comments . 'DELETE FROM {' . $this->connection->escapeTable($this->table) . '} ';
+    $query = $comments . 'DELETE FROM {' . $this->_connection->escapeTable($this->_table) . '} ';
 
-    if (count($this->condition)) {
+    if (count($this->_condition)) {
 
-      $this->condition->compile($this->connection, $this);
-      $query .= "\nWHERE " . $this->condition;
+      $this->_condition->compile($this->_connection, $this);
+      $query .= "\nWHERE " . $this->_condition;
     }
 
     return $query;
@@ -994,27 +994,27 @@ class TruncateQuery extends Query {
    *
    * @var string
    */
-  protected $table;
+  public $_table;
 
   public function __construct(DatabaseConnection $connection, $table, array $options = array()) {
     $options['return'] = Database::RETURN_AFFECTED;
     parent::__construct($connection, $options);
-    $this->table = $table;
+    $this->_table = $table;
   }
 
   public function compile(DatabaseConnection $connection, QueryPlaceholderInterface $queryPlaceholder = NULL) {
-    return $this->condition->compile($connection, isset($queryPlaceholder) ? $queryPlaceholder : $this);
+    return $this->_condition->compile($connection, isset($queryPlaceholder) ? $queryPlaceholder : $this);
   }
 
   public function execute() {
-    return $this->connection->query((string) $this, array(), $this->queryOptions);
+    return $this->_connection->query((string) $this, array(), $this->_queryOptions);
   }
 
   public function __toString() {
     // Create a comments string to prepend to the query.
-    $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : '';
+    $comments = (!empty($this->_comments)) ? '/* ' . implode('; ', $this->_comments) . ' */ ' : '';
 
-    return $comments . 'TRUNCATE {' . $this->connection->escapeTable($this->table) . '} ';
+    return $comments . 'TRUNCATE {' . $this->_connection->escapeTable($this->_table) . '} ';
   }
 }
 
@@ -1028,21 +1028,21 @@ class UpdateQuery extends Query implemen
    *
    * @var string
    */
-  protected $table;
+  public $_table;
 
   /**
    * An array of fields that will be updated.
    *
    * @var array
    */
-  protected $fields = array();
+  public $_fields = array();
 
   /**
    * An array of values to update to.
    *
    * @var array
    */
-  protected $arguments = array();
+  public $_arguments = array();
 
   /**
    * The condition object for this query. Condition handling is handled via
@@ -1050,7 +1050,7 @@ class UpdateQuery extends Query implemen
    *
    * @var DatabaseCondition
    */
-  protected $condition;
+  public $_condition;
 
   /**
    * An array of fields to update to an expression in case of a duplicate record.
@@ -1063,46 +1063,46 @@ class UpdateQuery extends Query implemen
    *
    * @var array
    */
-  protected $expressionFields = array();
+  public $_expressionFields = array();
 
   public function __construct(DatabaseConnection $connection, $table, array $options = array()) {
     $options['return'] = Database::RETURN_AFFECTED;
     parent::__construct($connection, $options);
-    $this->table = $table;
+    $this->_table = $table;
 
-    $this->condition = new DatabaseCondition('AND');
+    $this->_condition = new DatabaseCondition('AND');
   }
 
   public function condition($field, $value = NULL, $operator = NULL) {
-    $this->condition->condition($field, $value, $operator);
+    $this->_condition->condition($field, $value, $operator);
     return $this;
   }
 
   public function isNull($field) {
-    $this->condition->isNull($field);
+    $this->_condition->isNull($field);
     return $this;
   }
 
   public function isNotNull($field) {
-    $this->condition->isNotNull($field);
+    $this->_condition->isNotNull($field);
     return $this;
   }
 
   public function &conditions() {
-    return $this->condition->conditions();
+    return $this->_condition->conditions();
   }
 
   public function arguments() {
-    return $this->condition->arguments();
+    return $this->_condition->arguments();
   }
 
   public function where($snippet, $args = array()) {
-    $this->condition->where($snippet, $args);
+    $this->_condition->where($snippet, $args);
     return $this;
   }
 
   public function compile(DatabaseConnection $connection, QueryPlaceholderInterface $queryPlaceholder = NULL) {
-    return $this->condition->compile($connection, isset($queryPlaceholder) ? $queryPlaceholder : $this);
+    return $this->_condition->compile($connection, isset($queryPlaceholder) ? $queryPlaceholder : $this);
   }
 
   /**
@@ -1115,7 +1115,7 @@ class UpdateQuery extends Query implemen
    *   The called object.
    */
   public function fields(array $fields) {
-    $this->fields = $fields;
+    $this->_fields = $fields;
     return $this;
   }
 
@@ -1137,7 +1137,7 @@ class UpdateQuery extends Query implemen
    *   The called object.
    */
   public function expression($field, $expression, array $arguments = NULL) {
-    $this->expressionFields[$field] = array(
+    $this->_expressionFields[$field] = array(
       'expression' => $expression,
       'arguments' => $arguments,
     );
@@ -1149,9 +1149,9 @@ class UpdateQuery extends Query implemen
 
     // Expressions take priority over literal fields, so we process those first
     // and remove any literal fields that conflict.
-    $fields = $this->fields;
+    $fields = $this->_fields;
     $update_values = array();
-    foreach ($this->expressionFields as $field => $data) {
+    foreach ($this->_expressionFields as $field => $data) {
       if (!empty($data['arguments'])) {
         $update_values += $data['arguments'];
       }
@@ -1165,24 +1165,24 @@ class UpdateQuery extends Query implemen
       $update_values[':db_update_placeholder_' . ($max_placeholder++)] = $value;
     }
 
-    if (count($this->condition)) {
-      $this->condition->compile($this->connection, $this);
-      $update_values = array_merge($update_values, $this->condition->arguments());
+    if (count($this->_condition)) {
+      $this->_condition->compile($this->_connection, $this);
+      $update_values = array_merge($update_values, $this->_condition->arguments());
     }
 
-    return $this->connection->query((string) $this, $update_values, $this->queryOptions);
+    return $this->_connection->query((string) $this, $update_values, $this->_queryOptions);
   }
 
   public function __toString() {
 
     // Create a comments string to prepend to the query.
-    $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : '';
+    $comments = (!empty($this->_comments)) ? '/* ' . implode('; ', $this->_comments) . ' */ ' : '';
 
     // Expressions take priority over literal fields, so we process those first
     // and remove any literal fields that conflict.
-    $fields = $this->fields;
+    $fields = $this->_fields;
     $update_fields = array();
-    foreach ($this->expressionFields as $field => $data) {
+    foreach ($this->_expressionFields as $field => $data) {
       $update_fields[] = $field . '=' . $data['expression'];
       unset($fields[$field]);
     }
@@ -1192,12 +1192,12 @@ class UpdateQuery extends Query implemen
       $update_fields[] = $field . '=:db_update_placeholder_' . ($max_placeholder++);
     }
 
-    $query = $comments . 'UPDATE {' . $this->connection->escapeTable($this->table) . '} SET ' . implode(', ', $update_fields);
+    $query = $comments . 'UPDATE {' . $this->_connection->escapeTable($this->_table) . '} SET ' . implode(', ', $update_fields);
 
-    if (count($this->condition)) {
-      $this->condition->compile($this->connection, $this);
-      // There is an implicit string cast on $this->condition.
-      $query .= "\nWHERE " . $this->condition;
+    if (count($this->_condition)) {
+      $this->_condition->compile($this->_connection, $this);
+      // There is an implicit string cast on $this->_condition.
+      $query .= "\nWHERE " . $this->_condition;
     }
 
     return $query;
@@ -1210,13 +1210,13 @@ class UpdateQuery extends Query implemen
  */
 class DatabaseCondition implements QueryConditionInterface, Countable {
 
-  protected $conditions = array();
-  protected $arguments = array();
+  public $_conditions = array();
+  public $_arguments = array();
 
-  protected $changed = TRUE;
+  public $_changed = TRUE;
 
   public function __construct($conjunction) {
-    $this->conditions['#conjunction'] = $conjunction;
+    $this->_conditions['#conjunction'] = $conjunction;
   }
 
   /**
@@ -1226,7 +1226,7 @@ class DatabaseCondition implements Query
    * one, because one element is the the conjunction.
    */
   public function count() {
-    return count($this->conditions) - 1;
+    return count($this->_conditions) - 1;
   }
 
   public function condition($field, $value = NULL, $operator = NULL) {
@@ -1241,24 +1241,24 @@ class DatabaseCondition implements Query
         $operator = '=';
       }
     }
-    $this->conditions[] = array(
+    $this->_conditions[] = array(
       'field' => $field,
       'value' => $value,
       'operator' => $operator,
     );
 
-    $this->changed = TRUE;
+    $this->_changed = TRUE;
 
     return $this;
   }
 
   public function where($snippet, $args = array()) {
-    $this->conditions[] = array(
+    $this->_conditions[] = array(
       'field' => $snippet,
       'value' => $args,
       'operator' => NULL,
     );
-    $this->changed = TRUE;
+    $this->_changed = TRUE;
 
     return $this;
   }
@@ -1272,23 +1272,23 @@ class DatabaseCondition implements Query
   }
 
   public function &conditions() {
-    return $this->conditions;
+    return $this->_conditions;
   }
 
   public function arguments() {
     // If the caller forgot to call compile() first, refuse to run.
-    if ($this->changed) {
+    if ($this->_changed) {
       return NULL;
     }
-    return $this->arguments;
+    return $this->_arguments;
   }
 
   public function compile(DatabaseConnection $connection, QueryPlaceholderInterface $queryPlaceholder = NULL) {
-    if ($this->changed) {
+    if ($this->_changed) {
       $condition_fragments = array();
       $arguments = array();
 
-      $conditions = $this->conditions;
+      $conditions = $this->_conditions;
       $conjunction = $conditions['#conjunction'];
       unset($conditions['#conjunction']);
       foreach ($conditions as $condition) {
@@ -1350,25 +1350,25 @@ class DatabaseCondition implements Query
         }
       }
 
-      $this->changed = FALSE;
+      $this->_changed = FALSE;
       $this->stringVersion = implode($conjunction, $condition_fragments);
-      $this->arguments = $arguments;
+      $this->_arguments = $arguments;
     }
   }
 
   public function __toString() {
     // If the caller forgot to call compile() first, refuse to run.
-    if ($this->changed) {
+    if ($this->_changed) {
       return NULL;
     }
     return $this->stringVersion;
   }
 
   function __clone() {
-    $this->changed = TRUE;
-    foreach ($this->conditions as $key => $condition) {
+    $this->_changed = TRUE;
+    foreach ($this->_conditions as $key => $condition) {
       if ($condition['field'] instanceOf QueryConditionInterface) {
-        $this->conditions[$key]['field'] = clone($condition['field']);
+        $this->_conditions[$key]['field'] = clone($condition['field']);
       }
     }
   }

=== modified file 'includes/database/schema.inc'
--- includes/database/schema.inc	2010-08-22 13:55:53 +0000
+++ includes/database/schema.inc	2010-08-25 00:30:51 +0000
@@ -150,12 +150,12 @@
 
 abstract class DatabaseSchema implements QueryPlaceholderInterface {
 
-  protected $connection;
+  public $_connection;
 
   /**
    * The placeholder counter.
    */
-  protected $placeholder = 0;
+  public $_placeholder = 0;
 
   /**
    * Definition of prefixInfo array structure.
@@ -166,14 +166,14 @@ abstract class DatabaseSchema implements
    *
    * @see DatabaseSchema::getPrefixInfo()
    */
-  protected $defaultSchema = 'public';
+  public $_defaultSchema = 'public';
 
   public function __construct($connection) {
-    $this->connection = $connection;
+    $this->_connection = $connection;
   }
 
   public function nextPlaceholder() {
-    return $this->placeholder++;
+    return $this->_placeholder++;
   }
 
   /**
@@ -190,8 +190,8 @@ abstract class DatabaseSchema implements
    */
   protected function getPrefixInfo($table = 'default', $add_prefix = TRUE) {
     $info = array(
-      'schema' => $this->defaultSchema,
-      'prefix' => $this->connection->tablePrefix($table),
+      'schema' => $this->_defaultSchema,
+      'prefix' => $this->_connection->tablePrefix($table),
     );
     if ($add_prefix) {
       $table = $info['prefix'] . $table;
@@ -250,7 +250,7 @@ abstract class DatabaseSchema implements
    *   A DatabaseCondition object.
    */
   protected function buildTableNameCondition($table_name, $operator = '=', $add_prefix = TRUE) {
-    $info = $this->connection->getConnectionOptions();
+    $info = $this->_connection->getConnectionOptions();
 
     // Retrive the table name and schema
     $table_info = $this->getPrefixInfo($table_name, $add_prefix);
@@ -273,13 +273,13 @@ abstract class DatabaseSchema implements
    */
   public function tableExists($table) {
     $condition = $this->buildTableNameCondition($table);
-    $condition->compile($this->connection, $this);
+    $condition->compile($this->_connection, $this);
     // Normally, we would heartily discourage the use of string
     // concatenation for conditionals like this however, we
     // couldn't use db_select() here because it would prefix
     // information_schema.tables and the query would fail.
     // Don't use {} around information_schema.tables table.
-    return (bool) $this->connection->query("SELECT 1 FROM information_schema.tables WHERE " . (string) $condition, $condition->arguments())->fetchField();
+    return (bool) $this->_connection->query("SELECT 1 FROM information_schema.tables WHERE " . (string) $condition, $condition->arguments())->fetchField();
   }
 
   /**
@@ -295,13 +295,13 @@ abstract class DatabaseSchema implements
   public function findTables($table_expression) {
     $condition = $this->buildTableNameCondition($table_expression, 'LIKE', FALSE);
 
-    $condition->compile($this->connection, $this);
+    $condition->compile($this->_connection, $this);
     // Normally, we would heartily discourage the use of string
     // concatenation for conditionals like this however, we
     // couldn't use db_select() here because it would prefix
     // information_schema.tables and the query would fail.
     // Don't use {} around information_schema.tables table.
-    return $this->connection->query("SELECT table_name FROM information_schema.tables WHERE " . (string) $condition, $condition->arguments())->fetchAllKeyed(0, 0);
+    return $this->_connection->query("SELECT table_name FROM information_schema.tables WHERE " . (string) $condition, $condition->arguments())->fetchAllKeyed(0, 0);
   }
 
   /**
@@ -318,13 +318,13 @@ abstract class DatabaseSchema implements
   public function fieldExists($table, $column) {
     $condition = $this->buildTableNameCondition($table);
     $condition->condition('column_name', $column);
-    $condition->compile($this->connection, $this);
+    $condition->compile($this->_connection, $this);
     // Normally, we would heartily discourage the use of string
     // concatenation for conditionals like this however, we
     // couldn't use db_select() here because it would prefix
     // information_schema.tables and the query would fail.
     // Don't use {} around information_schema.columns table.
-    return (bool) $this->connection->query("SELECT 1 FROM information_schema.columns WHERE " . (string) $condition, $condition->arguments())->fetchField();
+    return (bool) $this->_connection->query("SELECT 1 FROM information_schema.columns WHERE " . (string) $condition, $condition->arguments())->fetchField();
   }
 
   /**
@@ -622,7 +622,7 @@ abstract class DatabaseSchema implements
     }
     $statements = $this->createTableSql($name, $table);
     foreach ($statements as $statement) {
-      $this->connection->query($statement);
+      $this->_connection->query($statement);
     }
   }
 
@@ -663,7 +663,7 @@ abstract class DatabaseSchema implements
    *   The prepared comment.
    */
   public function prepareComment($comment, $length = NULL) {
-    return $this->connection->quote($comment);
+    return $this->_connection->quote($comment);
   }
 }
 

=== modified file 'includes/database/select.inc'
--- includes/database/select.inc	2010-08-08 02:18:53 +0000
+++ includes/database/select.inc	2010-08-25 00:30:51 +0000
@@ -515,146 +515,146 @@ class SelectQueryExtender implements Sel
    *
    * @var SelectQueryInterface
    */
-  protected $query;
+  public $_query;
 
   /**
    * The connection object on which to run this query.
    *
    * @var DatabaseConnection
    */
-  protected $connection;
+  public $_connection;
 
   /**
    * The placeholder counter.
    */
-  protected $placeholder = 0;
+  public $_placeholder = 0;
 
   public function __construct(SelectQueryInterface $query, DatabaseConnection $connection) {
-    $this->query = $query;
-    $this->connection = $connection;
+    $this->_query = $query;
+    $this->_connection = $connection;
   }
 
   /* Implementations of QueryPlaceholderInterface. */
 
   public function nextPlaceholder() {
-    return $this->placeholder++;
+    return $this->_placeholder++;
   }
 
   /* Implementations of QueryAlterableInterface. */
 
   public function addTag($tag) {
-    $this->query->addTag($tag);
+    $this->_query->addTag($tag);
     return $this;
   }
 
   public function hasTag($tag) {
-    return $this->query->hasTag($tag);
+    return $this->_query->hasTag($tag);
   }
 
   public function hasAllTags() {
-    return call_user_func_array(array($this->query, 'hasAllTags'), func_get_args());
+    return call_user_func_array(array($this->_query, 'hasAllTags'), func_get_args());
   }
 
   public function hasAnyTag() {
-    return call_user_func_array(array($this->query, 'hasAnyTags'), func_get_args());
+    return call_user_func_array(array($this->_query, 'hasAnyTags'), func_get_args());
   }
 
   public function addMetaData($key, $object) {
-    $this->query->addMetaData($key, $object);
+    $this->_query->addMetaData($key, $object);
     return $this;
   }
 
   public function getMetaData($key) {
-    return $this->query->getMetaData($key);
+    return $this->_query->getMetaData($key);
   }
 
   /* Implementations of QueryConditionInterface for the WHERE clause. */
 
   public function condition($field, $value = NULL, $operator = NULL) {
-    $this->query->condition($field, $value, $operator);
+    $this->_query->condition($field, $value, $operator);
     return $this;
   }
 
   public function &conditions() {
-    return $this->query->conditions();
+    return $this->_query->conditions();
   }
 
   public function arguments() {
-    return $this->query->arguments();
+    return $this->_query->arguments();
   }
 
   public function where($snippet, $args = array()) {
-    $this->query->where($snippet, $args);
+    $this->_query->where($snippet, $args);
     return $this;
   }
 
   public function compile(DatabaseConnection $connection, QueryPlaceholderInterface $queryPlaceholder = NULL) {
-    return $this->condition->compile($connection, isset($queryPlaceholder) ? $queryPlaceholder : $this);
+    return $this->_condition->compile($connection, isset($queryPlaceholder) ? $queryPlaceholder : $this);
   }
 
   /* Implementations of QueryConditionInterface for the HAVING clause. */
 
   public function havingCondition($field, $value = NULL, $operator = '=') {
-    $this->query->condition($field, $value, $operator, $num_args);
+    $this->_query->condition($field, $value, $operator, $num_args);
     return $this;
   }
 
   public function &havingConditions() {
-    return $this->having->conditions();
+    return $this->_having->conditions();
   }
 
   public function havingArguments() {
-    return $this->having->arguments();
+    return $this->_having->arguments();
   }
 
   public function having($snippet, $args = array()) {
-    $this->query->having($snippet, $args);
+    $this->_query->having($snippet, $args);
     return $this;
   }
 
   public function havingCompile(DatabaseConnection $connection) {
-    return $this->query->havingCompile($connection);
+    return $this->_query->havingCompile($connection);
   }
 
   /* Implementations of QueryExtendableInterface. */
 
   public function extend($extender_name) {
-    $class = $this->connection->getDriverClass($extender_name);
-    return new $class($this, $this->connection);
+    $class = $this->_connection->getDriverClass($extender_name);
+    return new $class($this, $this->_connection);
   }
 
   /* Alter accessors to expose the query data to alter hooks. */
 
   public function &getFields() {
-    return $this->query->getFields();
+    return $this->_query->getFields();
   }
 
   public function &getExpressions() {
-    return $this->query->getExpressions();
+    return $this->_query->getExpressions();
   }
 
   public function &getOrderBy() {
-    return $this->query->getOrderBy();
+    return $this->_query->getOrderBy();
   }
 
   public function &getGroupBy() {
-    return $this->query->getGroupBy();
+    return $this->_query->getGroupBy();
   }
 
   public function &getTables() {
-    return $this->query->getTables();
+    return $this->_query->getTables();
   }
 
   public function &getUnion() {
-    return $this->query->getUnion();
+    return $this->_query->getUnion();
   }
 
   public function getArguments(QueryPlaceholderInterface $queryPlaceholder = NULL) {
-    return $this->query->getArguments($queryPlaceholder);
+    return $this->_query->getArguments($queryPlaceholder);
   }
 
   public function isPrepared() {
-    return $this->query->isPrepared();
+    return $this->_query->isPrepared();
   }
 
   public function preExecute(SelectQueryInterface $query = NULL) {
@@ -663,7 +663,7 @@ class SelectQueryExtender implements Sel
       $query = $this;
     }
 
-    return $this->query->preExecute($query);
+    return $this->_query->preExecute($query);
   }
 
   public function execute() {
@@ -674,69 +674,69 @@ class SelectQueryExtender implements Sel
       return NULL;
     }
 
-    return $this->query->execute();
+    return $this->_query->execute();
   }
 
   public function distinct($distinct = TRUE) {
-    $this->query->distinct($distinct);
+    $this->_query->distinct($distinct);
     return $this;
   }
 
   public function addField($table_alias, $field, $alias = NULL) {
-    return $this->query->addField($table_alias, $field, $alias);
+    return $this->_query->addField($table_alias, $field, $alias);
   }
 
   public function fields($table_alias, array $fields = array()) {
-    $this->query->fields($table_alias, $fields);
+    $this->_query->fields($table_alias, $fields);
     return $this;
   }
 
   public function addExpression($expression, $alias = NULL, $arguments = array()) {
-    return $this->query->addExpression($expression, $alias, $arguments);
+    return $this->_query->addExpression($expression, $alias, $arguments);
   }
 
   public function join($table, $alias = NULL, $condition = NULL, $arguments = array()) {
-    return $this->query->join($table, $alias, $condition, $arguments);
+    return $this->_query->join($table, $alias, $condition, $arguments);
   }
 
   public function innerJoin($table, $alias = NULL, $condition = NULL, $arguments = array()) {
-    return $this->query->innerJoin($table, $alias, $condition, $arguments);
+    return $this->_query->innerJoin($table, $alias, $condition, $arguments);
   }
 
   public function leftJoin($table, $alias = NULL, $condition = NULL, $arguments = array()) {
-    return $this->query->leftJoin($table, $alias, $condition, $arguments);
+    return $this->_query->leftJoin($table, $alias, $condition, $arguments);
   }
 
   public function rightJoin($table, $alias = NULL, $condition = NULL, $arguments = array()) {
-    return $this->query->rightJoin($table, $alias, $condition, $arguments);
+    return $this->_query->rightJoin($table, $alias, $condition, $arguments);
   }
 
   public function addJoin($type, $table, $alias = NULL, $condition = NULL, $arguments = array()) {
-    return $this->query->addJoin($type, $table, $alias, $condition, $arguments);
+    return $this->_query->addJoin($type, $table, $alias, $condition, $arguments);
   }
 
   public function orderBy($field, $direction = 'ASC') {
-    $this->query->orderBy($field, $direction);
+    $this->_query->orderBy($field, $direction);
     return $this;
   }
 
   public function orderRandom() {
-    $this->query->orderRandom();
+    $this->_query->orderRandom();
     return $this;
   }
 
   public function range($start = NULL, $length = NULL) {
-    $this->query->range($start, $length);
+    $this->_query->range($start, $length);
     return $this;
   }
 
   public function union(SelectQueryInterface $query, $type = '') {
-    $this->query->union($query, $type);
+    $this->_query->union($query, $type);
     return $this;
   }
 
   public function groupBy($field) {
-    $this->query->groupBy($field);
+    $this->_query->groupBy($field);
     return $this;
   }
 
@@ -769,23 +769,23 @@ class SelectQueryExtender implements Sel
   }
 
   function isNull($field) {
-    $this->query->isNull($field);
+    $this->_query->isNull($field);
     return $this;
   }
 
   function isNotNull($field) {
-    $this->query->isNotNull($field);
+    $this->_query->isNotNull($field);
     return $this;
   }
 
   public function __toString() {
-    return (string) $this->query;
+    return (string) $this->_query;
   }
 
   public function __clone() {
     // We need to deep-clone the query we're wrapping, which in turn may
     // deep-clone other objects.  Exciting!
-    $this->query = clone($this->query);
+    $this->_query = clone($this->_query);
   }
 
   /**
@@ -798,7 +798,7 @@ class SelectQueryExtender implements Sel
    * to handle any additional methods.
    */
   public function __call($method, $args) {
-    $return = call_user_func_array(array($this->query, $method), $args);
+    $return = call_user_func_array(array($this->_query, $method), $args);
 
     // Some methods will return the called object as part of a fluent interface.
     // Others will return some useful value.  If it's a value, then the caller
@@ -824,14 +824,14 @@ class SelectQuery extends Query implemen
    *
    * @var array
    */
-  protected $fields = array();
+  public $_fields = array();
 
   /**
    * The expressions to SELECT as virtual fields.
    *
    * @var array
    */
-  protected $expressions = array();
+  public $_expressions = array();
 
   /**
    * The tables against which to JOIN.
@@ -853,7 +853,7 @@ class SelectQuery extends Query implemen
    *
    * @var array
    */
-  protected $tables = array();
+  public $_tables = array();
 
   /**
    * The fields by which to order this query.
@@ -863,42 +863,42 @@ class SelectQuery extends Query implemen
    *
    * @var array
    */
-  protected $order = array();
+  public $_order = array();
 
   /**
    * The fields by which to group.
    *
    * @var array
    */
-  protected $group = array();
+  public $_group = array();
 
   /**
    * The conditional object for the WHERE clause.
    *
    * @var DatabaseCondition
    */
-  protected $where;
+  public $_where;
 
   /**
    * The conditional object for the HAVING clause.
    *
    * @var DatabaseCondition
    */
-  protected $having;
+  public $_having;
 
   /**
    * Whether or not this query should be DISTINCT
    *
    * @var boolean
    */
-  protected $distinct = FALSE;
+  public $_distinct = FALSE;
 
   /**
    * The range limiters for this query.
    *
    * @var array
    */
-  protected $range;
+  public $_range;
 
   /**
    * An array whose elements specify a query to UNION, and the UNION type. The
@@ -911,19 +911,19 @@ class SelectQuery extends Query implemen
    *
    * @var array
    */
-  protected $union = array();
+  public $_union = array();
 
   /**
    * Indicates if preExecute() has already been called.
    * @var boolean
    */
-  protected $prepared = FALSE;
+  public $_prepared = FALSE;
 
   public function __construct($table, $alias = NULL, DatabaseConnection $connection, $options = array()) {
     $options['return'] = Database::RETURN_STATEMENT;
     parent::__construct($connection, $options);
-    $this->where = new DatabaseCondition('AND');
-    $this->having = new DatabaseCondition('AND');
+    $this->_where = new DatabaseCondition('AND');
+    $this->_having = new DatabaseCondition('AND');
     $this->addJoin(NULL, $table, $alias);
   }
 
@@ -958,78 +958,78 @@ class SelectQuery extends Query implemen
   /* Implementations of QueryConditionInterface for the WHERE clause. */
 
   public function condition($field, $value = NULL, $operator = NULL) {
-    $this->where->condition($field, $value, $operator);
+    $this->_where->condition($field, $value, $operator);
     return $this;
   }
 
   public function &conditions() {
-    return $this->where->conditions();
+    return $this->_where->conditions();
   }
 
   public function arguments() {
-    return $this->where->arguments();
+    return $this->_where->arguments();
   }
 
   public function where($snippet, $args = array()) {
-    $this->where->where($snippet, $args);
+    $this->_where->where($snippet, $args);
     return $this;
   }
 
   public function isNull($field) {
-    $this->where->isNull($field);
+    $this->_where->isNull($field);
     return $this;
   }
 
   public function isNotNull($field) {
-    $this->where->isNotNull($field);
+    $this->_where->isNotNull($field);
     return $this;
   }
 
   public function compile(DatabaseConnection $connection, QueryPlaceholderInterface $queryPlaceholder = NULL) {
-    return $this->where->compile($connection, isset($queryPlaceholder) ? $queryPlaceholder : $this);
+    return $this->_where->compile($connection, isset($queryPlaceholder) ? $queryPlaceholder : $this);
   }
 
   /* Implementations of QueryConditionInterface for the HAVING clause. */
 
   public function havingCondition($field, $value = NULL, $operator = NULL) {
-    $this->having->condition($field, $value, $operator);
+    $this->_having->condition($field, $value, $operator);
     return $this;
   }
 
   public function &havingConditions() {
-    return $this->having->conditions();
+    return $this->_having->conditions();
   }
 
   public function havingArguments() {
-    return $this->having->arguments();
+    return $this->_having->arguments();
   }
 
   public function having($snippet, $args = array()) {
-    $this->having->where($snippet, $args);
+    $this->_having->where($snippet, $args);
     return $this;
   }
 
   public function havingCompile(DatabaseConnection $connection) {
-    return $this->having->compile($connection, $this);
+    return $this->_having->compile($connection, $this);
   }
 
   /* Implementations of QueryExtendableInterface. */
 
   public function extend($extender_name) {
-    $override_class = $extender_name . '_' . $this->connection->driver();
+    $override_class = $extender_name . '_' . $this->_connection->driver();
     if (class_exists($override_class)) {
       $extender_name = $override_class;
     }
-    return new $extender_name($this, $this->connection);
+    return new $extender_name($this, $this->_connection);
   }
 
   public function havingIsNull($field) {
-    $this->having->isNull($field);
+    $this->_having->isNull($field);
     return $this;
   }
 
   public function havingIsNotNull($field) {
-    $this->having->isNotNull($field);
+    $this->_having->isNotNull($field);
     return $this;
   }
 
@@ -1037,38 +1037,38 @@ class SelectQuery extends Query implemen
   /* Alter accessors to expose the query data to alter hooks. */
 
   public function &getFields() {
-    return $this->fields;
+    return $this->_fields;
   }
 
   public function &getExpressions() {
-    return $this->expressions;
+    return $this->_expressions;
   }
 
   public function &getOrderBy() {
-    return $this->order;
+    return $this->_order;
   }
 
   public function &getGroupBy() {
-    return $this->group;
+    return $this->_group;
   }
 
   public function &getTables() {
-    return $this->tables;
+    return $this->_tables;
   }
 
   public function &getUnion() {
-    return $this->union;
+    return $this->_union;
   }
 
   public function getArguments(QueryPlaceholderInterface $queryPlaceholder = NULL) {
     if (!isset($queryPlaceholder)) {
       $queryPlaceholder = $this;
     }
-    $this->where->compile($this->connection, $queryPlaceholder);
-    $this->having->compile($this->connection, $queryPlaceholder);
-    $args = $this->where->arguments() + $this->having->arguments();
+    $this->_where->compile($this->_connection, $queryPlaceholder);
+    $this->_having->compile($this->_connection, $queryPlaceholder);
+    $args = $this->_where->arguments() + $this->_having->arguments();
 
-    foreach ($this->tables as $table) {
+    foreach ($this->_tables as $table) {
       if ($table['arguments']) {
         $args += $table['arguments'];
       }
@@ -1078,7 +1078,7 @@ class SelectQuery extends Query implemen
       }
     }
 
-    foreach ($this->expressions as $expression) {
+    foreach ($this->_expressions as $expression) {
       if ($expression['arguments']) {
         $args += $expression['arguments'];
       }
@@ -1086,7 +1086,7 @@ class SelectQuery extends Query implemen
 
     // If there are any dependent queries to UNION,
     // incorporate their arguments recursively.
-    foreach ($this->union as $union) {
+    foreach ($this->_union as $union) {
       $args += $union['query']->getArguments($queryPlaceholder);
     }
 
@@ -1097,7 +1097,7 @@ class SelectQuery extends Query implemen
    * Indicates if preExecute() has already been called on that object.
    */
   public function isPrepared() {
-    return $this->prepared;
+    return $this->_prepared;
   }
 
   /**
@@ -1125,7 +1125,7 @@ class SelectQuery extends Query implemen
       }
       drupal_alter($hooks, $query);
     }
-    return $this->prepared = TRUE;
+    return $this->_prepared = TRUE;
   }
 
   public function execute() {
@@ -1136,11 +1136,11 @@ class SelectQuery extends Query implemen
     }
 
     $args = $this->getArguments();
-    return $this->connection->query((string) $this, $args, $this->queryOptions);
+    return $this->_connection->query((string) $this, $args, $this->_queryOptions);
   }
 
   public function distinct($distinct = TRUE) {
-    $this->distinct = $distinct;
+    $this->_distinct = $distinct;
     return $this;
   }
 
@@ -1151,19 +1151,19 @@ class SelectQuery extends Query implemen
     }
 
     // If that's already in use, try the table name and field name.
-    if (!empty($this->fields[$alias])) {
+    if (!empty($this->_fields[$alias])) {
       $alias = $table_alias . '_' . $field;
     }
 
     // If that is already used, just add a counter until we find an unused alias.
     $alias_candidate = $alias;
     $count = 2;
-    while (!empty($this->fields[$alias_candidate])) {
+    while (!empty($this->_fields[$alias_candidate])) {
       $alias_candidate = $alias . '_' . $count++;
     }
     $alias = $alias_candidate;
 
-    $this->fields[$alias] = array(
+    $this->_fields[$alias] = array(
       'field' => $field,
       'table' => $table_alias,
       'alias' => $alias,
@@ -1182,7 +1182,7 @@ class SelectQuery extends Query implemen
     }
     else {
       // We want all fields from this table.
-      $this->tables[$table_alias]['all_fields'] = TRUE;
+      $this->_tables[$table_alias]['all_fields'] = TRUE;
     }
 
     return $this;
@@ -1195,12 +1195,12 @@ class SelectQuery extends Query implemen
 
     $alias_candidate = $alias;
     $count = 2;
-    while (!empty($this->expressions[$alias_candidate])) {
+    while (!empty($this->_expressions[$alias_candidate])) {
       $alias_candidate = $alias . '_' . $count++;
     }
     $alias = $alias_candidate;
 
-    $this->expressions[$alias] = array(
+    $this->_expressions[$alias] = array(
       'expression' => $expression,
       'alias' => $alias,
       'arguments' => $arguments,
@@ -1238,7 +1238,7 @@ class SelectQuery extends Query implemen
 
     $alias_candidate = $alias;
     $count = 2;
-    while (!empty($this->tables[$alias_candidate])) {
+    while (!empty($this->_tables[$alias_candidate])) {
       $alias_candidate = $alias . '_' . $count++;
     }
     $alias = $alias_candidate;
@@ -1247,7 +1247,7 @@ class SelectQuery extends Query implemen
       $condition = str_replace('%alias', $alias, $condition);
     }
 
-    $this->tables[$alias] = array(
+    $this->_tables[$alias] = array(
       'join type' => $type,
       'table' => $table,
       'alias' => $alias,
@@ -1259,7 +1259,7 @@ class SelectQuery extends Query implemen
   }
 
   public function orderBy($field, $direction = 'ASC') {
-    $this->order[$field] = $direction;
+    $this->_order[$field] = $direction;
     return $this;
   }
 
@@ -1270,7 +1270,7 @@ class SelectQuery extends Query implemen
   }
 
   public function range($start = NULL, $length = NULL) {
-    $this->range = func_num_args() ? array('start' => $start, 'length' => $length) : array();
+    $this->_range = func_num_args() ? array('start' => $start, 'length' => $length) : array();
     return $this;
   }
 
@@ -1288,7 +1288,7 @@ class SelectQuery extends Query implemen
       default:
     }
 
-    $this->union[] = array(
+    $this->_union[] = array(
       'type' => $type,
       'query' => $query,
     );
@@ -1297,7 +1297,7 @@ class SelectQuery extends Query implemen
   }
 
   public function groupBy($field) {
-    $this->group[] = $field;
+    $this->_group[] = $field;
     return $this;
   }
 
@@ -1307,7 +1307,7 @@ class SelectQuery extends Query implemen
 
     $group_by = array_keys($count->getGroupBy());
 
-    if (!$count->distinct) {
+    if (!$count->_distinct) {
       // When not executing a distinct query, we can zero-out existing fields
       // and expressions that are not used by a GROUP BY.  Fields listed in
       // the GROUP BY clause need to be present in the query.
@@ -1326,7 +1326,7 @@ class SelectQuery extends Query implemen
 
       // Also remove 'all_fields' statements, which are expanded into tablename.*
       // when the query is executed.
-      foreach ($count->tables as $alias => &$table) {
+      foreach ($count->_tables as $alias => &$table) {
         unset($table['all_fields']);
       }
     }
@@ -1340,10 +1340,10 @@ class SelectQuery extends Query implemen
     $orders = &$count->getOrderBy();
     $orders = array();
 
-    if ($count->distinct && !empty($group_by)) {
+    if ($count->_distinct && !empty($group_by)) {
       // If the query is distinct and contains a GROUP BY, we need to remove the
       // distinct because SQL99 does not support counting on distinct multiple fields.
-      $count->distinct = FALSE;
+      $count->_distinct = FALSE;
     }
 
     $query = db_select($count);
@@ -1355,27 +1355,27 @@ class SelectQuery extends Query implemen
   public function __toString() {
 
     // Create a comments string to prepend to the query.
-    $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : '';
+    $comments = (!empty($this->_comments)) ? '/* ' . implode('; ', $this->_comments) . ' */ ' : '';
 
     // SELECT
     $query = $comments . 'SELECT ';
-    if ($this->distinct) {
+    if ($this->_distinct) {
       $query .= 'DISTINCT ';
     }
 
     // FIELDS and EXPRESSIONS
     $fields = array();
-    foreach ($this->tables as $alias => $table) {
+    foreach ($this->_tables as $alias => $table) {
       if (!empty($table['all_fields'])) {
-        $fields[] = $this->connection->escapeTable($alias) . '.*';
+        $fields[] = $this->_connection->escapeTable($alias) . '.*';
       }
     }
-    foreach ($this->fields as $alias => $field) {
+    foreach ($this->_fields as $alias => $field) {
       // Always use the AS keyword for field aliases, as some
       // databases require it (e.g., PostgreSQL).
-      $fields[] = (isset($field['table']) ? $this->connection->escapeTable($field['table']) . '.' : '') . $this->connection->escapeField($field['field']) . ' AS ' . $this->connection->escapeField($field['alias']);
+      $fields[] = (isset($field['table']) ? $this->_connection->escapeTable($field['table']) . '.' : '') . $this->_connection->escapeField($field['field']) . ' AS ' . $this->_connection->escapeField($field['alias']);
     }
-    foreach ($this->expressions as $alias => $expression) {
+    foreach ($this->_expressions as $alias => $expression) {
       $fields[] = $expression['expression'] . ' AS ' . $expression['alias'];
     }
     $query .= implode(', ', $fields);
@@ -1383,7 +1383,7 @@ class SelectQuery extends Query implemen
 
     // FROM - We presume all queries have a FROM, as any query that doesn't won't need the query builder anyway.
     $query .= "\nFROM ";
-    foreach ($this->tables as $alias => $table) {
+    foreach ($this->_tables as $alias => $table) {
       $query .= "\n";
       if (isset($table['join type'])) {
         $query .= $table['join type'] . ' JOIN ';
@@ -1397,12 +1397,12 @@ class SelectQuery extends Query implemen
         $table_string = '(' . (string) $subquery . ')';
       }
       else {
-        $table_string = '{' . $this->connection->escapeTable($table['table']) . '}';
+        $table_string = '{' . $this->_connection->escapeTable($table['table']) . '}';
       }
 
       // Don't use the AS keyword for table aliases, as some
       // databases don't support it (e.g., Oracle).
-      $query .=  $table_string . ' ' . $this->connection->escapeTable($table['alias']);
+      $query .=  $table_string . ' ' . $this->_connection->escapeTable($table['alias']);
 
       if (!empty($table['condition'])) {
         $query .= ' ON ' . $table['condition'];
@@ -1410,29 +1410,29 @@ class SelectQuery extends Query implemen
     }
 
     // WHERE
-    if (count($this->where)) {
-      $this->where->compile($this->connection, $this);
-      // There is an implicit string cast on $this->condition.
-      $query .= "\nWHERE " . $this->where;
+    if (count($this->_where)) {
+      $this->_where->compile($this->_connection, $this);
+      // There is an implicit string cast on $this->_condition.
+      $query .= "\nWHERE " . $this->_where;
     }
 
     // GROUP BY
-    if ($this->group) {
-      $query .= "\nGROUP BY " . implode(', ', $this->group);
+    if ($this->_group) {
+      $query .= "\nGROUP BY " . implode(', ', $this->_group);
     }
 
     // HAVING
-    if (count($this->having)) {
-      $this->having->compile($this->connection, $this);
-      // There is an implicit string cast on $this->having.
-      $query .= "\nHAVING " . $this->having;
+    if (count($this->_having)) {
+      $this->_having->compile($this->_connection, $this);
+      // There is an implicit string cast on $this->_having.
+      $query .= "\nHAVING " . $this->_having;
     }
 
     // ORDER BY
-    if ($this->order) {
+    if ($this->_order) {
       $query .= "\nORDER BY ";
       $fields = array();
-      foreach ($this->order as $field => $direction) {
+      foreach ($this->_order as $field => $direction) {
         $fields[] = $field . ' ' . $direction;
       }
       $query .= implode(', ', $fields);
@@ -1443,14 +1443,14 @@ class SelectQuery extends Query implemen
     // Fortunately, all core-supported databases use the same range syntax.
     // Databases that need a different syntax can override this method and
     // do whatever alternate logic they need to.
-    if (!empty($this->range)) {
-      $query .= "\nLIMIT " . (int) $this->range['length'] . " OFFSET " . (int) $this->range['start'];
+    if (!empty($this->_range)) {
+      $query .= "\nLIMIT " . (int) $this->_range['length'] . " OFFSET " . (int) $this->_range['start'];
     }
 
     // UNION is a little odd, as the select queries to combine are passed into
     // this query, but syntactically they all end up on the same level.
-    if ($this->union) {
-      foreach ($this->union as $union) {
+    if ($this->_union) {
+      foreach ($this->_union as $union) {
         $query .= ' ' . $union['type'] . ' ' . (string) $union['query'];
       }
     }
@@ -1463,10 +1463,10 @@ class SelectQuery extends Query implemen
     // want to clone the database connection object as that would duplicate the
     // connection itself.
 
-    $this->where = clone($this->where);
-    $this->having = clone($this->having);
-    foreach ($this->union as $key => $aggregate) {
-      $this->union[$key]['query'] = clone($aggregate['query']);
+    $this->_where = clone($this->_where);
+    $this->_having = clone($this->_having);
+    foreach ($this->_union as $key => $aggregate) {
+      $this->_union[$key]['query'] = clone($aggregate['query']);
     }
   }
 }

=== modified file 'includes/database/sqlite/database.inc'
--- includes/database/sqlite/database.inc	2010-08-11 02:17:39 +0000
+++ includes/database/sqlite/database.inc	2010-08-25 00:30:51 +0000
@@ -26,23 +26,23 @@ class DatabaseConnection_sqlite extends 
    *
    * @var bool
    */
-  protected $savepointSupport = FALSE;
+  public $_savepointSupport = FALSE;
 
   /**
    * Whether or not the active transaction (if any) will be rolled back.
    *
    * @var boolean
    */
-  protected $willRollback;
+  public $_willRollback;
 
   public function __construct(array $connection_options = array()) {
     // We don't need a specific PDOStatement class here, we simulate it below.
-    $this->statementClass = NULL;
+    $this->_statementClass = NULL;
 
     // This driver defaults to transaction support, except if explicitly passed FALSE.
-    $this->transactionSupport = !isset($connection_options['transactions']) || $connection_options['transactions'] !== FALSE;
+    $this->_transactionSupport = !isset($connection_options['transactions']) || $connection_options['transactions'] !== FALSE;
 
-    $this->connectionOptions = $connection_options;
+    $this->_connectionOptions = $connection_options;
 
     parent::__construct('sqlite:' . $connection_options['database'], '', '', array(
       // Force column names to lower case.
@@ -55,7 +55,7 @@ class DatabaseConnection_sqlite extends 
 
     // Detect support for SAVEPOINT.
     $version = $this->query('SELECT sqlite_version()')->fetchField();
-    $this->savepointSupport = (version_compare($version, '3.6.8') >= 0);
+    $this->_savepointSupport = (version_compare($version, '3.6.8') >= 0);
 
     // Create functions needed by SQLite.
     $this->sqliteCreateFunction('if', array($this, 'sqlFunctionIf'));
@@ -168,7 +168,7 @@ class DatabaseConnection_sqlite extends 
     // Generate a new temporary table name and protect it from prefixing.
     // SQLite requires that temporary tables to be non-qualified.
     $tablename = $this->generateTemporaryTableName();
-    $this->prefixes[$tablename] = '';
+    $this->_prefixes[$tablename] = '';
 
     $this->query(preg_replace('/^SELECT/i', 'CREATE TEMPORARY TABLE ' . $tablename . ' AS SELECT', $query), $args, $options);
     return $tablename;
@@ -221,7 +221,7 @@ class DatabaseConnection_sqlite extends 
   }
 
   public function rollback($savepoint_name = 'drupal_transaction') {
-    if ($this->savepointSupport) {
+    if ($this->_savepointSupport) {
       return parent::rollBack($savepoint_name);
     }
 
@@ -230,20 +230,20 @@ class DatabaseConnection_sqlite extends 
     }
     // A previous rollback to an earlier savepoint may mean that the savepoint
     // in question has already been rolled back.
-    if (!in_array($savepoint_name, $this->transactionLayers)) {
+    if (!in_array($savepoint_name, $this->_transactionLayers)) {
       return;
     }
 
     // We need to find the point we're rolling back to, all other savepoints
     // before are no longer needed.
-    while ($savepoint = array_pop($this->transactionLayers)) {
+    while ($savepoint = array_pop($this->_transactionLayers)) {
       if ($savepoint == $savepoint_name) {
         // Mark whole stack of transactions as needed roll back.
-        $this->willRollback = TRUE;
+        $this->_willRollback = TRUE;
         // If it is the last the transaction in the stack, then it is not a
         // savepoint, it is the transaction itself so we will need to roll back
         // the transaction rather than a savepoint.
-        if (empty($this->transactionLayers)) {
+        if (empty($this->_transactionLayers)) {
           break;
         }
         return;
@@ -255,23 +255,23 @@ class DatabaseConnection_sqlite extends 
   }
 
   public function pushTransaction($name) {
-    if ($this->savepointSupport) {
+    if ($this->_savepointSupport) {
       return parent::pushTransaction($name);
     }
     if (!$this->supportsTransactions()) {
       return;
     }
-    if (isset($this->transactionLayers[$name])) {
+    if (isset($this->_transactionLayers[$name])) {
       throw new DatabaseTransactionNameNonUniqueException($name . " is already in use.");
     }
     if (!$this->inTransaction()) {
       PDO::beginTransaction();
     }
-    $this->transactionLayers[$name] = $name;
+    $this->_transactionLayers[$name] = $name;
   }
 
   public function popTransaction($name) {
-    if ($this->savepointSupport) {
+    if ($this->_savepointSupport) {
       return parent::popTransaction($name);
     }
     if (!$this->supportsTransactions()) {
@@ -282,14 +282,14 @@ class DatabaseConnection_sqlite extends 
     }
 
     // Commit everything since SAVEPOINT $name.
-    while($savepoint = array_pop($this->transactionLayers)) {
+    while($savepoint = array_pop($this->_transactionLayers)) {
       if ($savepoint != $name) continue;
 
       // If there are no more layers left then we should commit or rollback.
-      if (empty($this->transactionLayers)) {
+      if (empty($this->_transactionLayers)) {
         // If there was any rollback() we should roll back whole transaction.
-        if ($this->willRollback) {
-          $this->willRollback = FALSE;
+        if ($this->_willRollback) {
+          $this->_willRollback = FALSE;
           PDO::rollBack();
         }
         elseif (!PDO::commit()) {
@@ -399,39 +399,39 @@ class DatabaseStatement_sqlite extends D
     // of the table. We post-process the data, by renaming the column names
     // using the same convention as MySQL and PostgreSQL.
     $rename_columns = array();
-    foreach ($this->columnNames as $k => $column) {
+    foreach ($this->_columnNames as $k => $column) {
       // In some SQLite versions, SELECT DISTINCT(field) will return "(field)"
       // instead of "field".
       if (preg_match("/^\((.*)\)$/", $column, $matches)) {
         $rename_columns[$column] = $matches[1];
-        $this->columnNames[$k] = $matches[1];
+        $this->_columnNames[$k] = $matches[1];
         $column = $matches[1];
       }
 
       // Remove "table." prefixes.
       if (preg_match("/^.*\.(.*)$/", $column, $matches)) {
         $rename_columns[$column] = $matches[1];
-        $this->columnNames[$k] = $matches[1];
+        $this->_columnNames[$k] = $matches[1];
       }
     }
     if ($rename_columns) {
       // DatabaseStatementPrefetch already extracted the first row,
       // put it back into the result set.
-      if (isset($this->currentRow)) {
-        $this->data[0] = &$this->currentRow;
+      if (isset($this->_currentRow)) {
+        $this->_data[0] = &$this->_currentRow;
       }
 
       // Then rename all the columns across the result set.
-      foreach ($this->data as $k => $row) {
+      foreach ($this->_data as $k => $row) {
         foreach ($rename_columns as $old_column => $new_column) {
-          $this->data[$k][$new_column] = $this->data[$k][$old_column];
-          unset($this->data[$k][$old_column]);
+          $this->_data[$k][$new_column] = $this->_data[$k][$old_column];
+          unset($this->_data[$k][$old_column]);
         }
       }
 
       // Finally, extract the first row again.
-      $this->currentRow = $this->data[0];
-      unset($this->data[0]);
+      $this->_currentRow = $this->_data[0];
+      unset($this->_data[0]);
     }
 
     return $return;

=== modified file 'includes/database/sqlite/install.inc'
--- includes/database/sqlite/install.inc	2009-07-27 19:42:54 +0000
+++ includes/database/sqlite/install.inc	2010-08-25 00:30:51 +0000
@@ -7,7 +7,7 @@
  */
 
 class DatabaseTasks_sqlite extends DatabaseTasks {
-  protected $pdoDriver = 'sqlite';
+  public $_pdoDriver = 'sqlite';
   public function name() {
     return 'SQLite';
   }

=== modified file 'includes/database/sqlite/query.inc'
--- includes/database/sqlite/query.inc	2010-07-03 20:45:45 +0000
+++ includes/database/sqlite/query.inc	2010-08-25 00:30:51 +0000
@@ -24,28 +24,28 @@ class InsertQuery_sqlite extends InsertQ
     if (!$this->preExecute()) {
       return NULL;
     }
-    if (count($this->insertFields)) {
+    if (count($this->_insertFields)) {
       return parent::execute();
     }
     else {
-      return $this->connection->query('INSERT INTO {' . $this->table . '} DEFAULT VALUES', array(), $this->queryOptions);
+      return $this->_connection->query('INSERT INTO {' . $this->_table . '} DEFAULT VALUES', array(), $this->_queryOptions);
     }
   }
 
   public function __toString() {
     // Create a comments string to prepend to the query.
-    $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : '';
+    $comments = (!empty($this->_comments)) ? '/* ' . implode('; ', $this->_comments) . ' */ ' : '';
 
     // Produce as many generic placeholders as necessary.
-    $placeholders = array_fill(0, count($this->insertFields), '?');
+    $placeholders = array_fill(0, count($this->_insertFields), '?');
 
     // If we're selecting from a SelectQuery, finish building the query and
     // pass it back, as any remaining options are irrelevant.
-    if (!empty($this->fromQuery)) {
-      return $comments . 'INSERT INTO {' . $this->table . '} (' . implode(', ', $this->insertFields) . ') ' . $this->fromQuery;
+    if (!empty($this->_fromQuery)) {
+      return $comments . 'INSERT INTO {' . $this->_table . '} (' . implode(', ', $this->_insertFields) . ') ' . $this->_fromQuery;
     }
 
-    return $comments . 'INSERT INTO {' . $this->table . '} (' . implode(', ', $this->insertFields) . ') VALUES (' . implode(', ', $placeholders) . ')';
+    return $comments . 'INSERT INTO {' . $this->_table . '} (' . implode(', ', $this->_insertFields) . ') VALUES (' . implode(', ', $placeholders) . ')';
   }
 
 }
@@ -83,14 +83,14 @@ class UpdateQuery_sqlite extends UpdateQ
   }
 
   public function execute() {
-    if (!empty($this->queryOptions['sqlite_return_matched_rows'])) {
+    if (!empty($this->_queryOptions['sqlite_return_matched_rows'])) {
       return parent::execute();
     }
 
     // Get the fields used in the update query, and remove those that are already
     // in the condition.
-    $fields = $this->expressionFields + $this->fields;
-    $this->removeFieldsInCondition($fields, $this->condition);
+    $fields = $this->_expressionFields + $this->_fields;
+    $this->removeFieldsInCondition($fields, $this->_condition);
 
     // Add the inverse of the fields to the condition.
     $condition = new DatabaseCondition('OR');
@@ -110,8 +110,8 @@ class UpdateQuery_sqlite extends UpdateQ
       }
     }
     if (count($condition)) {
-      $condition->compile($this->connection, $this);
-      $this->condition->where((string) $condition, $condition->arguments());
+      $condition->compile($this->_connection, $this);
+      $this->_condition->where((string) $condition, $condition->arguments());
     }
     return parent::execute();
   }
@@ -137,33 +137,33 @@ class MergeQuery_sqlite extends MergeQue
     }
 
     // Wrap multiple queries in a transaction.
-    $transaction = $this->connection->startTransaction();
+    $transaction = $this->_connection->startTransaction();
 
-    if ($this->updateFields) {
-      $update_fields = $this->updateFields;
+    if ($this->_updateFields) {
+      $update_fields = $this->_updateFields;
     }
     else {
-      $update_fields = $this->insertFields;
+      $update_fields = $this->_insertFields;
       // If there are no exclude fields, this is a no-op.
-      foreach ($this->excludeFields as $exclude_field) {
+      foreach ($this->_excludeFields as $exclude_field) {
         unset($update_fields[$exclude_field]);
       }
     }
 
     // The update fields are empty, fill them with dummy data.
-    if (!$update_fields && !$this->expressionFields) {
-      $update_fields = array_slice($this->keyFields, 0, 1);
+    if (!$update_fields && !$this->_expressionFields) {
+      $update_fields = array_slice($this->_keyFields, 0, 1);
     }
 
     // Start with an update query, this acquires a RESERVED lock on the database.
     // Use the SQLite-specific 'sqlite_return_matched_rows' query option to
     // return the number of rows matched by that query, not modified by it.
-    $update = $this->connection->update($this->table, array('sqlite_return_matched_rows' => TRUE) + $this->queryOptions)->fields($update_fields);
+    $update = $this->_connection->update($this->_table, array('sqlite_return_matched_rows' => TRUE) + $this->_queryOptions)->fields($update_fields);
 
-    foreach ($this->keyFields as $field => $value) {
+    foreach ($this->_keyFields as $field => $value) {
       $update->condition($field, $value);
     }
-    foreach ($this->expressionFields as $field => $expression) {
+    foreach ($this->_expressionFields as $field => $expression) {
       $update->expression($field, $expression['expression'], $expression['arguments']);
     }
     if ($update->execute()) {
@@ -171,8 +171,8 @@ class MergeQuery_sqlite extends MergeQue
     }
 
     // The UPDATE query failed to match rows, proceed with an INSERT.
-    $insert_fields = $this->insertFields + $this->keyFields;
-    $this->connection->insert($this->table, $this->queryOptions)->fields($insert_fields)->execute();
+    $insert_fields = $this->_insertFields + $this->_keyFields;
+    $this->_connection->insert($this->_table, $this->_queryOptions)->fields($insert_fields)->execute();
     return MergeQuery::STATUS_INSERT;
   }
 }
@@ -189,8 +189,8 @@ class MergeQuery_sqlite extends MergeQue
  */
 class DeleteQuery_sqlite extends DeleteQuery {
   public function execute() {
-    if (!count($this->condition)) {
-      $total_rows = $this->connection->query('SELECT COUNT(*) FROM {' . $this->connection->escapeTable($this->table) . '}')->fetchField();
+    if (!count($this->_condition)) {
+      $total_rows = $this->_connection->query('SELECT COUNT(*) FROM {' . $this->_connection->escapeTable($this->_table) . '}')->fetchField();
       parent::execute();
       return $total_rows;
     }
@@ -209,9 +209,9 @@ class DeleteQuery_sqlite extends DeleteQ
 class TruncateQuery_sqlite extends TruncateQuery {
   public function __toString() {
     // Create a comments string to prepend to the query.
-    $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : '';
+    $comments = (!empty($this->_comments)) ? '/* ' . implode('; ', $this->_comments) . ' */ ' : '';
 
-    return $comments . 'DELETE FROM {' . $this->connection->escapeTable($this->table) . '} ';
+    return $comments . 'DELETE FROM {' . $this->_connection->escapeTable($this->_table) . '} ';
   }
 }
 

=== modified file 'includes/database/sqlite/schema.inc'
--- includes/database/sqlite/schema.inc	2010-07-28 10:52:12 +0000
+++ includes/database/sqlite/schema.inc	2010-08-25 00:30:51 +0000
@@ -15,15 +15,15 @@
 class DatabaseSchema_sqlite extends DatabaseSchema {
 
   /**
-   * Override DatabaseSchema::$defaultSchema
+   * Override DatabaseSchema::$_defaultSchema
    */
-  protected $defaultSchema = 'main';
+  public $_defaultSchema = 'main';
 
   public function tableExists($table) {
     $info = $this->getPrefixInfo($table);
 
     // Don't use {} around sqlite_master table.
-    return (bool) $this->connection->query('SELECT 1 FROM ' . $info['schema'] . '.sqlite_master WHERE type = :type AND name = :name', array(':type' => 'table', ':name' => $info['table']))->fetchField();
+    return (bool) $this->_connection->query('SELECT 1 FROM ' . $info['schema'] . '.sqlite_master WHERE type = :type AND name = :name', array(':type' => 'table', ':name' => $info['table']))->fetchField();
   }
 
   public function fieldExists($table, $column) {
@@ -236,7 +236,7 @@ class DatabaseSchema_sqlite extends Data
     // the table with curly braces incase the db_prefix contains a reference
     // to a database outside of our existsing database.
     $info = $this->getPrefixInfo($new_name);
-    $this->connection->query('ALTER TABLE {' . $table . '} RENAME TO ' . $info['table']);
+    $this->_connection->query('ALTER TABLE {' . $table . '} RENAME TO ' . $info['table']);
 
     // Drop the indexes, there is no RENAME INDEX command in SQLite.
     if (!empty($schema['unique keys'])) {
@@ -253,7 +253,7 @@ class DatabaseSchema_sqlite extends Data
     // Recreate the indexes.
     $statements = $this->createIndexSql($new_name, $schema);
     foreach ($statements as $statement) {
-      $this->connection->query($statement);
+      $this->_connection->query($statement);
     }
   }
 
@@ -262,7 +262,7 @@ class DatabaseSchema_sqlite extends Data
       return FALSE;
     }
 
-    $this->connection->query('DROP TABLE {' . $table . '}');
+    $this->_connection->query('DROP TABLE {' . $table . '}');
     return TRUE;
   }
 
@@ -277,7 +277,7 @@ class DatabaseSchema_sqlite extends Data
     // TODO: $keys_new is not supported yet.
     $query = 'ALTER TABLE {' . $table . '} ADD ';
     $query .= $this->createFieldSql($field, $this->processField($spec));
-    $this->connection->query($query);
+    $this->_connection->query($query);
   }
 
   /**
@@ -307,7 +307,7 @@ class DatabaseSchema_sqlite extends Data
     $old_keys = array_keys($old_schema['fields']);
     $mapping += array_combine($old_keys, $old_keys);
 
-    $select = $this->connection->select($table);
+    $select = $this->_connection->select($table);
     $fields = &$select->getFields();
 
     // Map the fields.
@@ -323,12 +323,12 @@ class DatabaseSchema_sqlite extends Data
     }
 
     // Execute the data migration query.
-    $this->connection->insert($new_table)
+    $this->_connection->insert($new_table)
       ->from($select)
       ->execute();
 
-    $old_count = $this->connection->query('SELECT COUNT(*) FROM {' . $table . '}')->fetchField();
-    $new_count = $this->connection->query('SELECT COUNT(*) FROM {' . $new_table . '}')->fetchField();
+    $old_count = $this->_connection->query('SELECT COUNT(*) FROM {' . $table . '}')->fetchField();
+    $new_count = $this->_connection->query('SELECT COUNT(*) FROM {' . $new_table . '}')->fetchField();
     if ($old_count == $new_count) {
       $this->dropTable($table);
       $this->renameTable($new_table, $table);
@@ -358,7 +358,7 @@ class DatabaseSchema_sqlite extends Data
     );
 
     $info = $this->getPrefixInfo($table);
-    $result = $this->connection->query('PRAGMA ' . $info['schema'] . '.table_info(' . $info['table'] . ')');
+    $result = $this->_connection->query('PRAGMA ' . $info['schema'] . '.table_info(' . $info['table'] . ')');
     foreach ($result as $row) {
       if (preg_match('/^([^(]+)\((.*)\)$/', $row->type, $matches)) {
         $type = $matches[1];
@@ -388,7 +388,7 @@ class DatabaseSchema_sqlite extends Data
       }
     }
     $indexes = array();
-    $result = $this->connection->query('PRAGMA ' . $info['schema'] . '.index_list(' . $info['table'] . ')');
+    $result = $this->_connection->query('PRAGMA ' . $info['schema'] . '.index_list(' . $info['table'] . ')');
     foreach ($result as $row) {
       if (strpos($row->name, 'sqlite_autoindex_') !== 0) {
         $indexes[] = array(
@@ -401,7 +401,7 @@ class DatabaseSchema_sqlite extends Data
       $name = $index['name'];
       // Get index name without prefix.
       $index_name = substr($name, strlen($info['table']) + 1);
-      $result = $this->connection->query('PRAGMA ' . $info['schema'] . '.index_info(' . $name . ')');
+      $result = $this->_connection->query('PRAGMA ' . $info['schema'] . '.index_info(' . $name . ')');
       foreach ($result as $row) {
         $schema[$index['schema_key']][$index_name][] = $row->name;
       }
@@ -511,14 +511,14 @@ class DatabaseSchema_sqlite extends Data
     $schema['indexes'][$name] = $fields;
     $statements = $this->createIndexSql($table, $schema);
     foreach ($statements as $statement) {
-      $this->connection->query($statement);
+      $this->_connection->query($statement);
     }
   }
 
   public function indexExists($table, $name) {
     $info = $this->getPrefixInfo($table);
 
-    return $this->connection->query('PRAGMA ' . $info['schema'] . '.index_info(' . $info['table'] . '_' . $name . ')')->fetchField() != '';
+    return $this->_connection->query('PRAGMA ' . $info['schema'] . '.index_info(' . $info['table'] . '_' . $name . ')')->fetchField() != '';
   }
 
   public function dropIndex($table, $name) {
@@ -528,7 +528,7 @@ class DatabaseSchema_sqlite extends Data
 
     $info = $this->getPrefixInfo($table);
 
-    $this->connection->query('DROP INDEX ' . $info['schema'] . '.' . $info['table'] . '_' . $name);
+    $this->_connection->query('DROP INDEX ' . $info['schema'] . '.' . $info['table'] . '_' . $name);
     return TRUE;
   }
 
@@ -543,7 +543,7 @@ class DatabaseSchema_sqlite extends Data
     $schema['unique keys'][$name] = $fields;
     $statements = $this->createIndexSql($table, $schema);
     foreach ($statements as $statement) {
-      $this->connection->query($statement);
+      $this->_connection->query($statement);
     }
   }
 
@@ -554,7 +554,7 @@ class DatabaseSchema_sqlite extends Data
 
     $info = $this->getPrefixInfo($table);
 
-    $this->connection->query('DROP INDEX ' . $info['schema'] . '.' . $info['table'] . '_' . $name);
+    $this->_connection->query('DROP INDEX ' . $info['schema'] . '.' . $info['table'] . '_' . $name);
     return TRUE;
   }
 

=== modified file 'includes/install.inc'
--- includes/install.inc	2010-08-22 15:31:18 +0000
+++ includes/install.inc	2010-08-25 00:30:51 +0000
@@ -275,7 +275,7 @@ abstract class DatabaseTasks {
    * Each value of the tasks array is an associative array defining the function
    * to call (optional) and any arguments to be passed to the function.
    */
-  protected $tasks = array(
+  public $_tasks = array(
     array(
       'arguments'   => array(
         'CREATE TABLE drupal_install_test (id int NULL)',
@@ -318,27 +318,27 @@ abstract class DatabaseTasks {
    *
    * @var array
    */
-  protected $results = array();
+  public $_results = array();
 
   /**
    * Ensure the PDO driver is supported by the version of PHP in use.
    */
   protected function hasPdoDriver() {
-    return in_array($this->pdoDriver, PDO::getAvailableDrivers());
+    return in_array($this->_pdoDriver, PDO::getAvailableDrivers());
   }
 
   /**
    * Assert test as failed.
    */
   protected function fail($message) {
-    $this->results[$message] = FALSE;
+    $this->_results[$message] = FALSE;
   }
 
   /**
    * Assert test as a pass.
    */
   protected function pass($message) {
-    $this->results[$message] = TRUE;
+    $this->_results[$message] = TRUE;
   }
 
   /**
@@ -356,7 +356,7 @@ abstract class DatabaseTasks {
   public function runTasks() {
     // We need to establish a connection before we can run tests.
     if ($this->connect()) {
-      foreach ($this->tasks as $task) {
+      foreach ($this->_tasks as $task) {
         if (!isset($task['function'])) {
           $task['function'] = 'runTestQuery';
         }
@@ -373,7 +373,7 @@ abstract class DatabaseTasks {
     }
     // Check for failed results and compile message
     $message = '';
-    foreach ($this->results as $result => $success) {
+    foreach ($this->_results as $result => $success) {
       if (!$success) {
         $message .= '<p class="error">' . $result  . '</p>';
       }

=== modified file 'includes/pager.inc'
--- includes/pager.inc	2010-08-04 03:46:16 +0000
+++ includes/pager.inc	2010-08-25 00:32:38 +0000
@@ -77,7 +77,7 @@ class PagerDefault extends SelectQueryEx
     $this->range($current_page * $this->limit, $this->limit);
 
     // Now that we've added our pager-based range instructions, run the query normally.
-    return $this->query->execute();
+    return $this->_query->execute();
   }
 
   /**
@@ -122,7 +122,7 @@ class PagerDefault extends SelectQueryEx
       return $this->customCountQuery;
     }
     else {
-      return $this->query->countQuery();
+      return $this->_query->countQuery();
     }
   }
 

