[eluser]SneakyDave[/eluser]
I've seen this too in a recent app.
I have a general SELECT statement in which I turn off the automatic back ticks...
Code:
$this->CI->db->select('SQL_CALC_FOUND_ROWS `posts`.`id`, `posts`.`userid`,FALSE);
Once I do that, the protect_identifier function seems to be turned off..
Code:
$this->db->select(array(
$this->tables['users'].'.*',
$this->tables['groups'].'.name AS '. $this->db->protect_identifiers('group') ));
That gives me an SQL error because there aren't any back ticks.
If I add the back ticks to the first query:
Code:
$this->CI->db->select('SQL_CALC_FOUND_ROWS `posts`.`id`, `posts`.`userid`,TRUE);
Then the second query doesn't return an error, so it appears that the $this->db->protect_identifiers function can't be trusted if automatic back ticking is turned off.