Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added fix for the subquery strategy using the wrong alias when compar…
…ing. Previously, the subquery strategy was naively assuming that the alias used for comparing could be derived from the original query, but the right thing to do was to use the alias from the association object itself. Fixes #5769
- Loading branch information
Showing
3 changed files
with
83 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
/** | ||
* CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html> | ||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* | ||
* Licensed under The MIT License | ||
* For full copyright and license information, please see the LICENSE.txt | ||
* Redistributions of files must retain the above copyright notice | ||
* | ||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* @since 3.0.0 | ||
* @license http://www.opensource.org/licenses/mit-license.php MIT License | ||
*/ | ||
namespace Cake\Test\Fixture; | ||
|
||
use Cake\TestSuite\Fixture\TestFixture; | ||
|
||
/** | ||
* AuthorsTags fixture | ||
* | ||
*/ | ||
class AuthorsTagsFixture extends TestFixture | ||
{ | ||
|
||
/** | ||
* fields property | ||
* | ||
* @var array | ||
*/ | ||
public $fields = [ | ||
'author_id' => ['type' => 'integer', 'null' => false], | ||
'tag_id' => ['type' => 'integer', 'null' => false], | ||
'_constraints' => [ | ||
'unique_tag' => ['type' => 'primary', 'columns' => ['author_id', 'tag_id']], | ||
] | ||
]; | ||
|
||
/** | ||
* records property | ||
* | ||
* @var array | ||
*/ | ||
public $records = [ | ||
['author_id' => 3, 'tag_id' => 1], | ||
['author_id' => 3, 'tag_id' => 2], | ||
['author_id' => 2, 'tag_id' => 1], | ||
['author_id' => 2, 'tag_id' => 3] | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters