You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
Not really a bug, the first parameter of join() is the name of the table to join, not some arbitrary piece of SQL.
And the functionality was probably not included because its syntax is DB specific, so you can't make a generic compiler. The posibility to have per-driver compilers was only introduced recently.
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 ( PRIMARYThanks!
The text was updated successfully, but these errors were encountered: