summaryrefslogtreecommitdiff
path: root/includes/database/mysql
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2013-12-25 14:57:44 -0500
committerDavid Rothstein <drothstein@gmail.com>2013-12-25 14:57:44 -0500
commitcbabb1a24bf40e74363efbf0401ba8d37b8c9799 (patch)
tree6bee867bdb60e2ceacf02ca670026f7dd2bcdd83 /includes/database/mysql
parent6c89f3924e7e375e634b52f539520b9125789431 (diff)
downloadbrdo-cbabb1a24bf40e74363efbf0401ba8d37b8c9799.tar.gz
brdo-cbabb1a24bf40e74363efbf0401ba8d37b8c9799.tar.bz2
Issue #2056363 by yched, Sweetchuck, chx: INSERT INTO table SELECT * FROM ... not supported.
Diffstat (limited to 'includes/database/mysql')
-rw-r--r--includes/database/mysql/query.inc3
1 files changed, 2 insertions, 1 deletions
diff --git a/includes/database/mysql/query.inc b/includes/database/mysql/query.inc
index fa698d90c..d3d2d9eec 100644
--- a/includes/database/mysql/query.inc
+++ b/includes/database/mysql/query.inc
@@ -51,7 +51,8 @@ class InsertQuery_mysql extends InsertQuery {
// If we're selecting from a SelectQuery, finish building the query and
// pass it back, as any remaining options are irrelevant.
if (!empty($this->fromQuery)) {
- return $comments . 'INSERT INTO {' . $this->table . '} (' . implode(', ', $insert_fields) . ') ' . $this->fromQuery;
+ $insert_fields_string = $insert_fields ? ' (' . implode(', ', $insert_fields) . ') ' : ' ';
+ return $comments . 'INSERT INTO {' . $this->table . '}' . $insert_fields_string . $this->fromQuery;
}
$query = $comments . 'INSERT INTO {' . $this->table . '} (' . implode(', ', $insert_fields) . ') VALUES ';