[eluser]Sam Dark[/eluser]
Mironoff reported this one in russian community forum. Confirmed on 1.6.2.
Code:
$this->db->from('text');
$this->db->join('link2tree','link2tree.link_text = text.id','left');
$this->db->where('link2tree.link_text IS NULL');
$this->db->where('text.trash',0);
$this->db->order_by('sort');
$this->db->get();
Gives us:
Code:
Error Number: 1109
Unknown table '000_link2tree.link_text00_text' in on clause
SELECT * FROM (`000_text`) LEFT JOIN `000_link2tree` ON 000_link2tree.link_text00_text.id WHERE 000_link2tree.link_text IS NULL AND 000_text.trash = 0 ORDER BY `sort`
It's in DB_active_rec.php:
Code:
// If a DB prefix is used we might need to add it to the column names
if ($this->dbprefix)
{
$this->_track_aliases($table);
// First we remove any existing prefixes in the condition to avoid duplicates
$cond = preg_replace('|('.$this->dbprefix.')([\w\.]+)([\W\s]+)|', "$2$3", $cond);
// Next we add the prefixes to the condition
$cond = preg_replace('|([\w\.]+)([\W\s]+)(.+)|', $this->dbprefix . "$1$2" . $this->dbprefix . "$3", $cond);
}
And when changing
Code:
// Next we add the prefixes to the condition
$cond = preg_replace('|([\w\.]+)([\W\s]+)(.+)|', $this->dbprefix . "$1$2" . $this->dbprefix . "$3", $cond);
to
Code:
// Next we add the prefixes to the condition
$cond = preg_replace('|([\w\.]+)([\W\s]+)|', $this->dbprefix . "$1$2", $cond);
everything works.