Google Groups Home
Help | Sign in
#1209: ATTR_QUOTE_IDENTIFIER Doctrine_Query->getCountQuery() postgresql
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Doctrine  
View profile
 More options 4 Jul, 08:27
From: "Doctrine" <no-re...@phpdoctrine.org>
Date: Fri, 04 Jul 2008 07:27:48 -0000
Local: Fri 4 Jul 2008 08:27
Subject: [Doctrine] #1209: ATTR_QUOTE_IDENTIFIER Doctrine_Query->getCountQuery() postgresql
#1209: ATTR_QUOTE_IDENTIFIER Doctrine_Query->getCountQuery()  postgresql
-----------------------------------+--------------------------------------- -
 Reporter:  abusquets              |       Owner:  jwage
     Type:  defect                 |      Status:  new  
 Priority:  critical               |   Milestone:  0.11.1
Component:  Attributes             |     Version:  0.11  
 Keywords:                         |    Has_test:  0    
 Mystatus:  Pending Core Response  |   Has_patch:  0    
-----------------------------------+--------------------------------------- -
 PHP 5.2.5[[BR]]
 Apache 2.2[[BR]]
 PostgreSQL 8.1[[BR]]
 Doctrine 0.11.0[[BR]]

 Doctrine_Query->getCountQuery() function not works correctly with the
 Doctrine::ATTR_QUOTE_IDENTIFIER.[[BR]]
 I have the Doctrine::ATTR_QUOTE_IDENTIFIER => true[[BR]]
 I'm working with the Pager and[[BR]]

 Doctrine_Query->getCountQuery() creates this sql count[[BR]]

 SELECT COUNT(DISTINCT p.7_parcela) AS num_results FROM "parcela" "p"
 GROUP BY p.7_parcela

 and the correct sql should be

 SELECT COUNT(DISTINCT "p"."7_parcela") AS num_results FROM "parcela"
 "p" GROUP BY "p"."7_parcela"

 {{{
 <?php
 define('DOCTRINE_PATH',
 realpath(dirname(__file__)."/../").DIRECTORY_SEPARATOR.'library'.DIRECTORY_ SEPARATOR.'Doctrine');
 define('SANDBOX_PATH',
 realpath(dirname(__file__)."/../").DIRECTORY_SEPARATOR.'application');

 define('DATA_FIXTURES_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR .
 'doctrine' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR .
 'fixtures');
 define('MODELS_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'models');
 define('MIGRATIONS_PATH',  SANDBOX_PATH . DIRECTORY_SEPARATOR . 'doctrine'
 . DIRECTORY_SEPARATOR . 'migrations');
 define('SQL_PATH',  SANDBOX_PATH . DIRECTORY_SEPARATOR . 'doctrine' .
 DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'sql');
 define('YAML_SCHEMA_PATH',  SANDBOX_PATH . DIRECTORY_SEPARATOR .
 'doctrine' . DIRECTORY_SEPARATOR . 'schema');

 define('DSN', 'pgsql://postgres:123456@server:5432/prova');

 require_once(DOCTRINE_PATH . DIRECTORY_SEPARATOR . 'Doctrine.php');
 spl_autoload_register(array('Doctrine', 'autoload'));
 Doctrine_Manager::connection(DSN, 'sandbox');
 Doctrine_Manager::getInstance()->setAttribute(Doctrine::ATTR_QUOTE_IDENTIFI ER
 , true);

 abstract class BaseParcela extends Doctrine_Record
 {

         public function setTableDefinition()
         {
                 $this->setTableName('parcela');
                 $this->hasColumn('1_acreedor', 'integer', 4,
 array('unsigned' => false, 'notnull' => false, 'primary' => false));
                 $this->hasColumn('2_nom', 'string', 255, array('fixed' =>
 false, 'notnull' => false, 'primary' => false));
                 $this->hasColumn('3_verema', 'string', 255, array('fixed'
 => false, 'notnull' => false, 'primary' => false));
                 $this->hasColumn('4_centre', 'string', 255, array('fixed'
 => false, 'notnull' => false, 'primary' => false));
                 $this->hasColumn('5_nom', 'string', 255, array('fixed' =>
 false, 'notnull' => false, 'primary' => false));
                 $this->hasColumn('6_ind_fina', 'string', 255,
 array('fixed' => false, 'notnull' => false, 'primary' => false));
                 $this->hasColumn('7_parcela as id', 'integer', 4,
 array('unsigned' => false, 'notnull' => true, 'primary' => true));
         }

         public function setUp()
         {
                 parent::setUp();
         }

 }

 class Parcela extends BaseParcela{}

 $query = Doctrine_Query::create()->from('Parcela');

 $pager = new Doctrine_Pager(
 $query ,
 1,
 2
 );

 $pager->execute();

 }}}

--
Ticket URL: <http://trac.phpdoctrine.org/ticket/1209>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Doctrine  
View profile
 More options 4 Jul, 15:11
From: "Doctrine" <no-re...@phpdoctrine.org>
Date: Fri, 04 Jul 2008 14:11:26 -0000
Local: Fri 4 Jul 2008 15:11
Subject: Re: [Doctrine] #1209: ATTR_QUOTE_IDENTIFIER Doctrine_Query->getCountQuery() postgresql
#1209: ATTR_QUOTE_IDENTIFIER Doctrine_Query->getCountQuery()  postgresql
------------------------------+-------------------------------------------- -
  Reporter:  abusquets        |       Owner:  romanb              
      Type:  defect           |      Status:  new                  
  Priority:  critical         |   Milestone:  0.11.1              
 Component:  Query/Hydration  |     Version:  0.11                
Resolution:                   |    Keywords:                      
  Has_test:  0                |    Mystatus:  Pending Core Response
 Has_patch:  0                |  
------------------------------+-------------------------------------------- -
Changes (by abusquets):

  * owner:  jwage => romanb
  * component:  Attributes => Query/Hydration

--
Ticket URL: <http://trac.phpdoctrine.org/ticket/1209#comment:1>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Doctrine  
View profile
 More options 9 Jul, 04:44
From: "Doctrine" <no-re...@phpdoctrine.org>
Date: Wed, 09 Jul 2008 03:44:43 -0000
Local: Wed 9 Jul 2008 04:44
Subject: Re: [Doctrine] #1209: ATTR_QUOTE_IDENTIFIER Doctrine_Query->getCountQuery() postgresql
#1209: ATTR_QUOTE_IDENTIFIER Doctrine_Query->getCountQuery()  postgresql
------------------------------+-------------------------------------------- -
  Reporter:  abusquets        |       Owner:  romanb              
      Type:  defect           |      Status:  closed              
  Priority:  critical         |   Milestone:  0.11.1              
 Component:  Query/Hydration  |     Version:  0.11                
Resolution:  fixed            |    Keywords:                      
  Has_test:  0                |    Mystatus:  Pending Core Response
 Has_patch:  0                |  
------------------------------+-------------------------------------------- -
Changes (by guilhermeblanco):

  * status:  new => closed
  * resolution:  => fixed

Comment:

 (In [4645]) Fixed #1209 and added coverage to it. Added new methods:
 Doctrine_Connection->quoteMultipleIdentifier and
 Doctrine_Formatter->quoteMultipleIdentifier.

--
Ticket URL: <http://doctrine.pengus.net/cgi-bin/trac.cgi/ticket/1209#comment:2>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google