Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.11.5

Request #2702 Links in multiple databases
Submitted: 2004-11-05 16:39 UTC
From: p dot kirov at gmail dot com Assigned:
Status: No Feedback Package: DB_DataObject
PHP Version: Irrelevant OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2004-11-05 16:39 UTC] p dot kirov at gmail dot com
Description: ------------ The DB_DataObject provide wrong sql when try to link from one database to other. Below is patch that i was created. I am not shire that this is the right way, but work for me. My database is Oracle, and i am not make test for other db. Hmmm, Is this way to send pathc? Reproduce code: --------------- --- DataObject.php 2004-11-05 15:02:03.000000000 +0200 +++ DataObjectnew.php 2004-11-05 15:03:02.000000000 +0200 @@ -2785,18 +2785,18 @@ $fullJoinAs = "AS {$joinAs}"; } + $database = $this->_database != $obj->_database ? strtoupper ( $DB->quoteIdentifier( $obj->_database ) ) . '.' : ''; switch ($joinType) { case 'INNER': case 'LEFT': case 'RIGHT': // others??? .. cross, left outer, right outer, natural..? - $this->_join .= "\n {$joinType} JOIN {$objTable} {$fullJoinAs}". - " ON {$joinAs}.{$ofield}={$table}.{$tfield} {$appendJoin} "; + $this->_join .= "\n {$joinType} JOIN {$database}{$objTable} {$fullJoinAs}". + " ON {$database}{$joinAs}.{$ofield}={$table}.{$tfield} {$appendJoin} "; break; case '': // this is just a standard multitable select.. $this->_join .= "\n , {$objTable} {$fullJoinAs} {$appendJoin}"; $this->whereAdd("{$joinAs}.{$ofield}={$table}.{$tfield}"); } - // if obj only a dataobject - eg. no extended class has been defined.. // it obvioulsy cant work out what child elements might exist... // untill we get on the fly querying of tables..

Comments

 [2004-11-13 06:18 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2005-02-01 12:28 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!