From 44c8391d327f589fb5e96bb7bbe0c08db1611441 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 13 Nov 2008 21:08:16 +0000 Subject: - Patch #321100 by hswong3i: empty insert statements are better handled now. Comes with tests. --- includes/database/pgsql/query.inc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'includes/database/pgsql') diff --git a/includes/database/pgsql/query.inc b/includes/database/pgsql/query.inc index dc9054a99..a489cbeae 100644 --- a/includes/database/pgsql/query.inc +++ b/includes/database/pgsql/query.inc @@ -22,6 +22,10 @@ class InsertQuery_pgsql extends InsertQuery { throw new PDOException('You may not specify the same field to have a value and a schema-default value.'); } + if (count($this->insertFields) + count($this->defaultFields) == 0) { + return NULL; + } + $schema = drupal_get_schema($this->table); $stmt = $this->connection->prepareQuery((string)$this); -- cgit v1.2.3