-
Notifications
You must be signed in to change notification settings - Fork 344
Open
Labels
Description
Hello,
Currently, I am tired with JOIN and DB :: expr()
Is the code below a bug?
if ($this->_table instanceof \Database_Query_Builder_Select)
{
// Compile the subquery and add it
$sql .= ' ('.$this->_table->compile().')';
}
elseif ($this->_table instanceof \Database_Expression)
{
// Compile the expression and add its value
$sql .= ' ('.trim($this->_table->value(), ' ()').')'; <== bug
}
Why trim() with ' ()' is used?
Example, i am using in my code:
$qr->join(DB::expr(" table FORCE INDEX(PRIMARY) "), 'INNER');
Its make after of ')' is lost.
table FORCE INDEX ( PRIMARY
Thanks!