summaryrefslogtreecommitdiff
path: root/includes/database/pgsql
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-05-20 05:44:03 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-05-20 05:44:03 +0000
commite5350c1905275af6d5b9df925106cfc7a6f0b12f (patch)
treedcde2cf5ff4292b36dcc8a7f692f821915f3aa10 /includes/database/pgsql
parent9df38a58a4430e544e484e74bba37825914317f0 (diff)
downloadbrdo-e5350c1905275af6d5b9df925106cfc7a6f0b12f.tar.gz
brdo-e5350c1905275af6d5b9df925106cfc7a6f0b12f.tar.bz2
#445214 by Josh Waihi: Fix drupal_write_record() to correctly deal with NULL serial columns.
Diffstat (limited to 'includes/database/pgsql')
-rw-r--r--includes/database/pgsql/query.inc10
1 files changed, 4 insertions, 6 deletions
diff --git a/includes/database/pgsql/query.inc b/includes/database/pgsql/query.inc
index f3a4932ea..39a132bdd 100644
--- a/includes/database/pgsql/query.inc
+++ b/includes/database/pgsql/query.inc
@@ -14,11 +14,6 @@
class InsertQuery_pgsql extends InsertQuery {
- public function __construct($connection, $table, array $options = array()) {
- 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
@@ -69,7 +64,10 @@ class InsertQuery_pgsql extends InsertQuery {
if (!empty($table_information->sequences)) {
$options['sequence_name'] = $table_information->sequences[0];
- $options['return'] = Database::RETURN_INSERT_ID;
+ }
+ // If there are no sequences then we can't get a last insert id.
+ elseif ($options['return'] == Database::RETURN_INSERT_ID) {
+ $options['return'] = Database::RETURN_NULL;
}
$last_insert_id = $this->connection->query($stmt, array(), $options);