Skip to content

To much escaping in where #691

Description

@nowackipawel
    public function getSthByDomainId($domain_id) {
        $this->[WITH or WITHOUT builder() HERE]->select('sth_id')
            ->where('sth1_sth_id', "(SELECT `aaa_bbb_id` FROM `t_abc` WHERE `aaa_id` = " . $this->db->escapeString($domain_id) .")", FALSE)
            ->get()
            ->getResult();
        d($this->db->getLastQuery());

produces escaped query instead of FALSE passing as a third parameter of ->where method.

SELECT sth_idFROMt_sth_sthWHERE sth1_sth_id = '\(SELECTaaa_bbb_idFROMt_abcWHEREaaa_id \= 1\)'


Edit after a minute:
OK everything is ok when as second parameter we will pass NULL as is in docs, but anyway will be more useful if we would be able to pass field name as first parameter, subquery as second and false as third.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions