From e5350c1905275af6d5b9df925106cfc7a6f0b12f Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Wed, 20 May 2009 05:44:03 +0000 Subject: #445214 by Josh Waihi: Fix drupal_write_record() to correctly deal with NULL serial columns. --- includes/database/query.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'includes/database/query.inc') diff --git a/includes/database/query.inc b/includes/database/query.inc index 8cdaaf5e1..db0cd31ed 100644 --- a/includes/database/query.inc +++ b/includes/database/query.inc @@ -288,7 +288,9 @@ class InsertQuery extends Query { protected $insertValues = array(); public function __construct($connection, $table, array $options = array()) { - $options['return'] = Database::RETURN_INSERT_ID; + if (!isset($options['return'])) { + $options['return'] = Database::RETURN_INSERT_ID; + } $options += array('delay' => FALSE); parent::__construct($connection, $options); $this->table = $table; -- cgit v1.2.3