diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-11-13 21:08:16 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-11-13 21:08:16 +0000 |
commit | 44c8391d327f589fb5e96bb7bbe0c08db1611441 (patch) | |
tree | 7fbf766b62bd09abfbb1c9c230528b7a49188ae0 /includes/database/pgsql | |
parent | a269b9cc1d224c1fd0fa63306c84896c37fef173 (diff) | |
download | brdo-44c8391d327f589fb5e96bb7bbe0c08db1611441.tar.gz brdo-44c8391d327f589fb5e96bb7bbe0c08db1611441.tar.bz2 |
- Patch #321100 by hswong3i: empty insert statements are better handled now. Comes with tests.
Diffstat (limited to 'includes/database/pgsql')
-rw-r--r-- | includes/database/pgsql/query.inc | 4 |
1 files changed, 4 insertions, 0 deletions
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); |