Commit 6e8c9253 authored by webchick's avatar webchick

Issue #2180539 by chx: Do not attempt prefixing cross database / schema queries.

parent 91d82b43
......@@ -710,7 +710,11 @@ public function __toString() {
$table_string = '(' . (string) $subquery . ')';
}
else {
$table_string = '{' . $this->connection->escapeTable($table['table']) . '}';
$table_string = $this->connection->escapeTable($table['table']);
// Do not attempt prefixing cross database / schema queries.
if (strpos($table_string, '.') === FALSE) {
$table_string = '{' . $table_string . '}';
}
}
// Don't use the AS keyword for table aliases, as some
......
......@@ -216,7 +216,10 @@ public function addExpression($expression, $alias = NULL, $arguments = array());
* This method is a convenience method for innerJoin().
*
* @param $table
* The table against which to join.
* The table against which to join. May be a string or another SelectQuery
* object. If a query object is passed, it will be used as a subselect.
* Unless the table name starts with the database / schema name and a dot
* it will be prefixed.
* @param $alias
* The alias for the table. In most cases this should be the first letter
* of the table, or the first letter of each "word" in the table.
......@@ -239,7 +242,10 @@ public function join($table, $alias = NULL, $condition = NULL, $arguments = arra
* Inner Join against another table in the database.
*
* @param $table
* The table against which to join.
* The table against which to join. May be a string or another SelectQuery
* object. If a query object is passed, it will be used as a subselect.
* Unless the table name starts with the database / schema name and a dot
* it will be prefixed.
* @param $alias
* The alias for the table. In most cases this should be the first letter
* of the table, or the first letter of each "word" in the table.
......@@ -262,7 +268,10 @@ public function innerJoin($table, $alias = NULL, $condition = NULL, $arguments =
* Left Outer Join against another table in the database.
*
* @param $table
* The table against which to join.
* The table against which to join. May be a string or another SelectQuery
* object. If a query object is passed, it will be used as a subselect.
* Unless the table name starts with the database / schema name and a dot
* it will be prefixed.
* @param $alias
* The alias for the table. In most cases this should be the first letter
* of the table, or the first letter of each "word" in the table.
......@@ -285,7 +294,10 @@ public function leftJoin($table, $alias = NULL, $condition = NULL, $arguments =
* Right Outer Join against another table in the database.
*
* @param $table
* The table against which to join.
* The table against which to join. May be a string or another SelectQuery
* object. If a query object is passed, it will be used as a subselect.
* Unless the table name starts with the database / schema name and a dot
* it will be prefixed.
* @param $alias
* The alias for the table. In most cases this should be the first letter
* of the table, or the first letter of each "word" in the table.
......@@ -316,6 +328,8 @@ public function rightJoin($table, $alias = NULL, $condition = NULL, $arguments =
* @param $table
* The table against which to join. May be a string or another SelectQuery
* object. If a query object is passed, it will be used as a subselect.
* Unless the table name starts with the database / schema name and a dot
* it will be prefixed.
* @param $alias
* The alias for the table. In most cases this should be the first letter
* of the table, or the first letter of each "word" in the table. If omitted,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment