#1671: Column aggregation inheritance based on bool in PgSQL
-----------------------------------+----------------------------------------
 Reporter:  j.debowczyk            |       Owner:  romanb
     Type:  defect                 |      Status:  new   
 Priority:  major                  |   Milestone:        
Component:  Query/Hydration        |     Version:  1.0.3 
 Keywords:  pgsql inheritnace      |    Has_test:  1     
 Mystatus:  Pending Core Response  |   Has_patch:  0     
-----------------------------------+----------------------------------------
 I have following record classes which uses column aggregation inheritance
 based on bool column "child1":

 {{{
 class Jacek_BoolSubclass_Parent extends Doctrine_Record
 {
         public function setTableDefinition()
         {
                 parent::setTableDefinition();
             $this->hasColumn('id', 'integer', 4, array('ntype' => 'int4',
 'alltypes' =>  array(  0 => 'integer', ), 'unsigned' => false, 'notnull'
 => true, 'primary' => true));
                 $this->hasColumn('child1', 'boolean');
                 $this->setSubclasses(array(
                                 'Jacek_BoolSubclass_Child1' => array
 ('child1' => true),
                                 'Jacek_BoolSubclass_Child2' => array
 ('child1' => false)
                 ));
         }

 }

 class Jacek_BoolSubclass_Child1 extends Jacek_BoolSubclass_Parent
 {}

 class Jacek_BoolSubclass_Child2 extends Jacek_BoolSubclass_Parent
 {}

 }}}

 When quering directly from one subclass, Doctrine builds broken queries:

 {{{
 SELECT j.id AS j__id, j.child1 AS j__child1 FROM
 jacek__bool_subclass__parent j WHERE (j.child1 = '1')
 }}}

 and

 {{{
 SELECT j.id AS j__id, j.child1 AS j__child1 FROM
 jacek__bool_subclass__parent j WHERE (j.child1 = '')
 }}}

 These forms of WHERE condition aren't acceptable in PostgreSQL.

 Doctrine 1.0.3, PostgreSQL 8.3.

 Testcase included.
 PS. Is it proper form of testcase for this situation?

-- 
Ticket URL: <http://trac.doctrine-project.org/ticket/1671>
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to