Introduction of “protect_identifiers” breaks many valid queries |
|||
|---|---|---|---|
| Date: | 02/05/2008 | Severity: | Major |
| Status: | Bogus | Reporter: | smartinec |
| Version: | 1.6.0 | ||
| Keywords: | Libraries, Database Class | ||
Description
The protect_identifiers code quotes far too many items. I know this option can be turned off, but now I have to go add it to every select statement in my application or edit the system library. This option should be off by default. It was obviously only tested with simplistic SQL statements.
Code Sample
$CI->db->select("IF( fieldname IS NULL , 0 , fieldname ) AS fieldname")->from("tablename");
Expected Result
SELECT IF( fieldname IS NULL , 0 , fieldname ) AS fieldname FROM tablename
Actual Result
SELECT IF( fieldname `IS` NULL , `0` , fieldname ) AS fieldname FROM tablename
Comment on Bug Report
| Posted by: smartinec on 5 February 2008 3:16pm | |
|
|
Please explain why this is bogus? The protect_identifiers code does not work and incorrectly quotes valid queries? |
