diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2008-09-15 20:48:10 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2008-09-15 20:48:10 +0000 |
commit | 161a9970f77ce6813e710e08076f5d4fc494259a (patch) | |
tree | 3d349326150a59d58bbaf868148fd197e8ca903c /includes/database/pgsql | |
parent | cf987be12d600a513f5efa779602ad4b6682e147 (diff) | |
download | brdo-161a9970f77ce6813e710e08076f5d4fc494259a.tar.gz brdo-161a9970f77ce6813e710e08076f5d4fc494259a.tar.bz2 |
#308534 by Dave Reid: Remove stray whitespace core-wide.
Diffstat (limited to 'includes/database/pgsql')
-rw-r--r-- | includes/database/pgsql/database.inc | 6 | ||||
-rw-r--r-- | includes/database/pgsql/query.inc | 26 | ||||
-rw-r--r-- | includes/database/pgsql/schema.inc | 2 |
3 files changed, 17 insertions, 17 deletions
diff --git a/includes/database/pgsql/database.inc b/includes/database/pgsql/database.inc index 85a8e8315..166811235 100644 --- a/includes/database/pgsql/database.inc +++ b/includes/database/pgsql/database.inc @@ -33,7 +33,7 @@ class DatabaseConnection_pgsql extends DatabaseConnection { public function query($query, Array $args = array(), $options = array()) { $options += $this->defaultOptions(); - + try { if ($query instanceof DatabaseStatement) { $stmt = $query; @@ -43,7 +43,7 @@ class DatabaseConnection_pgsql extends DatabaseConnection { $stmt = $this->prepareQuery($query); $stmt->execute($args, $options); } - + switch ($options['return']) { case Database::RETURN_STATEMENT: return $stmt; @@ -74,7 +74,7 @@ class DatabaseConnection_pgsql extends DatabaseConnection { return NULL; } } - + public function queryRange($query, Array $args, $from, $count, Array $options) { // Backward compatibility hack, temporary. $query = str_replace(array('%d' , '%f' , '%b' , "'%s'"), '?', $query); diff --git a/includes/database/pgsql/query.inc b/includes/database/pgsql/query.inc index 4f3a08da6..dc9054a99 100644 --- a/includes/database/pgsql/query.inc +++ b/includes/database/pgsql/query.inc @@ -13,9 +13,9 @@ class InsertQuery_pgsql extends InsertQuery { parent::__construct($connection, $table, $options); $this->queryOptions['return'] = Database::RETURN_NULL; } - + public function execute() { - + // Confirm that the user did not try to specify an identical // field and default field. if (array_intersect($this->insertFields, $this->defaultFields)) { @@ -53,13 +53,13 @@ class InsertQuery_pgsql extends InsertQuery { // when requesting the last insert ID, so we pass that in via // the options array. $options = $this->queryOptions; - + if ($schema['fields'][$schema['primary key'][0]]['type'] == 'serial') { $options['sequence_name'] = $this->connection->makeSequenceName($this->table, $schema['primary key'][0]); $options['return'] = Database::RETURN_INSERT_ID; } $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(); @@ -67,7 +67,7 @@ class InsertQuery_pgsql extends InsertQuery { } public function __toString() { - + // Default fields are always placed first for consistency. $insert_fields = array_merge($this->defaultFields, $this->insertFields); @@ -78,11 +78,11 @@ class InsertQuery_pgsql extends InsertQuery { 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'); - + $new_placeholder = $max_placeholder + count($insert_values); for ($i = $max_placeholder; $i < $new_placeholder; ++$i) { $placeholders[] = ':db_insert_placeholder_' . $i; @@ -103,18 +103,18 @@ class InsertQuery_pgsql extends InsertQuery { } } -class UpdateQuery_pgsql extends UpdateQuery { +class UpdateQuery_pgsql extends UpdateQuery { public function execute() { $max_placeholder = 0; $blobs = array(); $blob_count = 0; - + $schema = drupal_get_schema($this->table); - + // Because we filter $fields the same way here and in __toString(), the // placeholders will all match up properly. $stmt = $this->connection->prepareQuery((string)$this); - + // Expressions take priority over literal fields, so we process those first // and remove any literal fields that conflict. $fields = $this->fields; @@ -130,7 +130,7 @@ class UpdateQuery_pgsql extends UpdateQuery { } unset($fields[$field]); } - + foreach ($fields as $field => &$value) { $placeholder = ':db_update_placeholder_' . ($max_placeholder++); @@ -160,7 +160,7 @@ class UpdateQuery_pgsql extends UpdateQuery { $options = $this->queryOptions; $options['already_prepared'] = TRUE; $this->connection->query($stmt, $options); - + //$stmt->execute(NULL, $this->queryOptions); return $stmt->rowCount(); } diff --git a/includes/database/pgsql/schema.inc b/includes/database/pgsql/schema.inc index fa817c4d1..c98818a26 100644 --- a/includes/database/pgsql/schema.inc +++ b/includes/database/pgsql/schema.inc @@ -16,7 +16,7 @@ class DatabaseSchema_pgsql extends DatabaseSchema { public function tableExists($table) { return (bool) db_result(db_query("SELECT COUNT(*) FROM pg_class WHERE relname = '{" . db_escape_table($table) . "}'")); } - + public function columnExists($table, $column) { return (bool) db_result(db_query("SELECT COUNT(pg_attribute.attname) FROM pg_class, pg_attribute WHERE pg_attribute.attrelid = pg_class.oid AND pg_class.relname = '{" . db_escape_table($table) . "}' AND attname = '" . db_escape_table($column) . "'")); } |