Doctrine Project

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Doctrine 2 - ORM
  • Doctrine 2 - ORM
  • DDC-660

quoting not-in-values

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0-BETA3
  • Fix Version/s: 2.0-BETA3
  • Component/s: ORM
  • Security Level: All
  • Labels:
    None
  • Environment:
    Win7

Description

There seems to be a bug in ORM/Query/expr.php method notIn. All literals should be quoted like:

    /**
     * Creates a NOT IN() expression with the given arguments.
     *
     * @param string $x Field in string format to be restricted by NOT IN() function
     * @param mixed $y Argument to be used in NOT IN() function.
     * @return Expr\Func
     */
    public function notIn($x, $y)
    {
        if (is_array($y)) {
            foreach ($y as &$literal) { 
                if ( ! ($literal instanceof Expr\Literal)) { 
                    $literal = $this->_quoteLiteral($literal);
                }
            }
        }
        return new Expr\Func($x . ' NOT IN', (array) $y);
    }

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • History
  • Activity
  • Source
Hide
Permalink
Dietmar Bauer added a comment - 29/Jun/10 11:50 AM

Of course without "unknown macro" in the code!

Show
Dietmar Bauer added a comment - 29/Jun/10 11:50 AM Of course without "unknown macro" in the code!
Hide
Permalink
Benjamin Eberlei added a comment - 29/Jun/10 4:42 PM

this was fixed for the in() function already some time ago, good oversight

Show
Benjamin Eberlei added a comment - 29/Jun/10 4:42 PM this was fixed for the in() function already some time ago, good oversight
Hide
Permalink
Dietmar Bauer added a comment - 01/Jul/10 4:27 AM - edited

added

{ code }

to description

Show
Dietmar Bauer added a comment - 01/Jul/10 4:27 AM - edited added { code } to description
Hide
Permalink
Benjamin Eberlei added a comment - 01/Jul/10 3:43 PM

fixed

Show
Benjamin Eberlei added a comment - 01/Jul/10 3:43 PM fixed

People

  • Assignee:
    Benjamin Eberlei
    Reporter:
    Dietmar Bauer
Vote (0)
Watch (0)

Dates

  • Created:
    29/Jun/10 11:38 AM
    Updated:
    01/Jul/10 3:43 PM
    Resolved:
    01/Jul/10 3:43 PM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Doctrine Project. Try JIRA - bug tracking software for your team.