summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2008-11-08 04:18:08 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2008-11-08 04:18:08 +0000
commit6159c302e13aac5a6a1152064fda236edd9f04d0 (patch)
tree999385111fa085080e0777cdf7cd702820bbe8ee
parent8f093858f7700d7729dfe92fc256fb2543decd77 (diff)
downloadbrdo-6159c302e13aac5a6a1152064fda236edd9f04d0.tar.gz
brdo-6159c302e13aac5a6a1152064fda236edd9f04d0.tar.bz2
Oops. Reverting #329223. Still needs work.
-rw-r--r--includes/database/mysql/query.inc7
-rw-r--r--includes/database/pgsql/query.inc7
2 files changed, 4 insertions, 10 deletions
diff --git a/includes/database/mysql/query.inc b/includes/database/mysql/query.inc
index 7ea0f20ce..58fc8eb22 100644
--- a/includes/database/mysql/query.inc
+++ b/includes/database/mysql/query.inc
@@ -45,7 +45,7 @@ class InsertQuery_mysql extends InsertQuery {
$max_placeholder = 0;
$values = array();
- if ($this->insertValues) {
+ if (count($this->insertValues)) {
foreach ($this->insertValues as $insert_values) {
$placeholders = array();
@@ -61,14 +61,11 @@ class InsertQuery_mysql extends InsertQuery {
$values[] = '('. implode(', ', $placeholders) .')';
}
}
- elseif ($this->defaultFields) {
+ else {
// If there are no values, then this is a default-only query. We still need to handle that.
$placeholders = array_fill(0, count($this->defaultFields), 'default');
$values[] = '(' . implode(', ', $placeholders) .')';
}
- else {
- $values[] = '(default)';
- }
$query .= implode(', ', $values);
diff --git a/includes/database/pgsql/query.inc b/includes/database/pgsql/query.inc
index 97e7cc135..dc9054a99 100644
--- a/includes/database/pgsql/query.inc
+++ b/includes/database/pgsql/query.inc
@@ -75,7 +75,7 @@ class InsertQuery_pgsql extends InsertQuery {
$max_placeholder = 0;
$values = array();
- if ($this->insertValues) {
+ if (count($this->insertValues)) {
foreach ($this->insertValues as $insert_values) {
$placeholders = array();
@@ -91,14 +91,11 @@ class InsertQuery_pgsql extends InsertQuery {
$values[] = '(' . implode(', ', $placeholders) . ')';
}
}
- elseif ($this->defaultFields) {
+ else {
// If there are no values, then this is a default-only query. We still need to handle that.
$placeholders = array_fill(0, count($this->defaultFields), 'default');
$values[] = '(' . implode(', ', $placeholders) .')';
}
- else {
- $values[] = '(default)';
- }
$query .= implode(', ', $values);