ZF-1838: findManyToManyRowset fails because the table _schema attribute isn't used

Issue Type: Bug Created: 2007-08-09T08:03:52.000+0000 Last Updated: 2009-01-14T13:34:14.000+0000 Status: Resolved Fix version(s): - 1.7.3 (19/Jan/09)

Reporter: Duarte Fonseca (dfonseca) Assignee: Benjamin Eberlei (beberlei) Tags: - Zend_Db_Table

Related issues: - ZF-5380

Attachments: - scenario_test_manytomany_row.php


in Zend_Db_Table_Row_Abstract the method findManyToManyRowset doesnt use the _schema attribute for the tables involved in the operation, fixed it by changing the following code

<pre class="highlight">
$interInfo = $intersectionTable->info();
$interName =  $interInfo['name'];
$matchInfo = $matchTable->info();
$matchName = $matchInfo['name'];

to this

<pre class="highlight">
$interInfo = $intersectionTable->info();
$interName = ( isset($interInfo['schema']) ? $interInfo['schema'] . '.' : '') . $interInfo['name'];
$matchInfo = $matchTable->info();
$matchName = ( isset($matchInfo['schema']) ? $matchInfo['schema'] . '.' : '') . $matchInfo['name'];


Posted by Darby Felton (darby) on 2007-08-09T10:39:20.000+0000

Assigning to [~bkarwin] to initiate issue review.

Posted by Seth Thornberry (stm) on 2007-11-11T17:10:00.000+0000

I have also come across this issue, and the attached fix works for me.


Posted by Alejandro Henríquez Lazo (ahenriquez) on 2008-02-21T12:51:10.000+0000

Possible functional solution

<pre class="highlight">        //line 946:
        $interInfo   = $intersectionTable->info();
        $interName   = $interInfo['name'];
        $interSchema = isset($interInfo['schema']) ? $interInfo['schema'] : null;  //Add line
        $matchInfo   = $matchTable->info();
        $matchName   = $matchInfo['name'];
        $matchSchema = isset($matchInfo['schema']) ? $matchInfo['schema'] : null;  //Add line

<pre class="highlight">       //line 960
        $select->from(array('i' => $interName), '*', $interSchema)  //To modify line
               ->joinInner(array('m' => $matchName), $joinCond, '*', $matchSchema)  //To modify line

Posted by Jan Pieper (jpieper) on 2008-03-06T16:56:33.000+0000

I need this patch. I patched it in my sources manually but it would be great if this will be soon committed to svn.

Posted by Wil Sinclair (wil) on 2008-03-21T17:05:33.000+0000

This issue should have been fixed for the 1.5 release.

Posted by Wil Sinclair (wil) on 2008-03-25T20:43:58.000+0000

Please categorize/fix as needed.

Posted by Jan Pieper (jpieper) on 2008-04-12T19:06:47.000+0000

This issue is now 8 months old. Why this isn´t fixed until yet? I patched my local copy of zend framework in less than a minute.

Posted by Wil Sinclair (wil) on 2008-04-18T13:11:55.000+0000

This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.

Posted by Jan Pieper (jpieper) on 2008-06-19T14:38:52.000+0000

10 months and still waiting.

Posted by Jan Pieper (jpieper) on 2008-10-04T02:56:16.000+0000

13 months and still waiting.

Posted by Rob Allen (rob) on 2008-10-04T06:49:26.000+0000


Do you think you could write test case that proves the fix?



Posted by Benjamin Eberlei (beberlei) on 2009-01-08T06:04:45.000+0000

The Zend_Db Testsuite is a hazzle to work with, I have to say.

Why is there no Mock Db Adapter that is used completly for a complete test run of Zend_Db_Table?

I do make the following assumptions for my workaround, implemented as a scenario test-case.

  1. The bug completely depends on Zend_Db_Select
  2. Zend_Db_Select testcases therefore cover the changes in their unittest suites.
  3. I build a scenario testcase for pdo_mysql and printed the before, after select statements of the ManyToMany.

This logic argument should cover the testcase 100%, thanks :-) I'll commit the patch.

Posted by Benjamin Eberlei (beberlei) on 2009-01-08T06:05:28.000+0000

Scenario test that works with the Database schema out of the ZF Db manual.

Posted by Jan Pieper (jpieper) on 2009-01-08T06:58:41.000+0000

Thanks for your work :)

Posted by Benjamin Eberlei (beberlei) on 2009-01-14T12:49:19.000+0000

merged back into 1.7 release branch because of possible 1.7.3 release

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.