#1540: AND converted to && (ampersands) in WHERE clause if inside function
-----------------------------------+----------------------------------------
Reporter: bobo_italy | Owner: romanb
Type: defect | Status: new
Priority: major | Milestone:
Component: Query/Hydration | Version: 1.0.2
Keywords: | Has_test: 1
Mystatus: Pending Core Response | Has_patch: 0
-----------------------------------+----------------------------------------
When you write something like:
{{{
$query = Doctrine_Query::create()
->select('name')
->where('IF(1 AND 2, 1, 0)')
->from('Table');
}}}
the resulting query will be
{{{
SELECT p.id AS p__id, p.nome AS p__nome FROM table p WHERE IF(1 && 2, 1,
0)
}}}
instead of
{{{
SELECT p.id AS p__id, p.nome AS p__nome FROM table p WHERE IF(1 AND 2, 1,
0)
}}}
but if you write:
{{{
$query = Doctrine_Query::create()
->select('name')
->where('1 AND 2')
->from('Table');
}}}
or
{{{
$query = Doctrine_Query::create()
->select('name, IF(1 AND 2, 1, 0)')
->from('PPUser');
}}}
it will give the correct result (AND is not converted to &&).
This is with MySQL backend, PHP 5.2.6, and Doctrine 1.0.2 (SVN 5053), but
happened also with 1.0.
--
Ticket URL: <http://trac.doctrine-project.org/ticket/1540>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"doctrine-svn" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---