Part of the EllisLab Network

Bug Report

ActiveScript library doesn’t add backticks when custom operator is used

Date: 06/06/2008 Severity: Minor
Status: Resolved Reporter: Maxaon
Version: 1.6.2
Keywords: Libraries, Database Class

Description

in my code (where CI is a codeigniter instance)

$this->CI->db->where(“left >”, (int)$record[$this->left_column]);

produces: ...WHERE left > 11…

$this->CI->db->where(“left”, (int)$record[$this->left_column]);

produces: ...WHERE `left` = 11…

In the former case, where I am using a custom operator the backticks are not produced and I have to insert them myself. This seems to be fairly inconsistent and inconvenient. Please consider fixing this.

Suggested fix:
change line 444 in DB_active_rec.php from
$k = preg_replace(”/([A-Za-z_0-9]+)/”, $this->_protect_identifiers(’$1’), $k);
to
$k = preg_replace(”/([A-Za-z_0-9]+)/e”, ‘$this->_protect_identifiers(”\\1”)’, $k);

Expected Result

WHERE `left` = 11

Actual Result

WHERE left > 11

Comment on Bug Report

Page 1 of 1 pages
Posted by: Maxaon on 6 June 2008 4:27pm
no avatar

err I meant ActiveRecord

Name:

Email:

Location:

URL:

Remember my personal information

Notify me of follow-up comments?