Welcome Guest, Not a member yet? Register   Sign In
Query Builder Protect Identifiers Disable

(07-20-2015, 02:36 AM)Narf Wrote: This should solve it: https://github.com/bcit-ci/CodeIgniter/c...7d333c5e04

However, as explained in the commit message - this is NOT a valid use case and setting _protect_identifiers to FALSE is a hack that you should never use.

Thanks Narf!  It would be nice if there could be a way to turn it off that was not considered a hack.  I know this came over from the previous version of CI, but I struggle to see why it is forcing to protect everything with back ticks out of the box.  It would be nice if it was something that could be flipped on globally or per query build for db's that used reserved words, but I would hope that would be more of an outlier situation to have to use it.  It looks like there is a lot of logic built up under there now to try and figure out what is actually referencing a column ore table, and it is being run through there multiple times per query.  I am not sure what the cost of this is, but it would have to seem like it may be an unnecessary performance hit most of the time.

On another note, I think I ran across another bug in the query builder.  I can file a bug report for it, assuming I am not using the query builder wrong...

In my "From" clause, I am specifying a table alias that is get identifiers put around the alias.  I was trying to go down the road of passing FALSE to each method, but it does not look like the from() has that option.

from('mytable m');

ends up producing

FROM `mytable` `m`

Messages In This Thread
RE: Query Builder Protect Identifiers Disable - by zepernick - 07-20-2015, 06:10 AM

Theme © iAndrew 2016 - Forum software by © MyBB