Skip to content

Commit 32ed181

Browse files
committed
Update DQL arbitrary joins to use the ON keyword instead of WITH
DQL arbitrary joins are semantically equivalent to SQL joins, so using the same keyword reduces confusion. It also means that in next major version, the WITH keyword will only be about applying adhoc filtering on relations instead of having 2 responsibilities.
1 parent a7a14cf commit 32ed181

File tree

13 files changed

+72
-40
lines changed

13 files changed

+72
-40
lines changed

docs/en/reference/dql-doctrine-query-language.rst

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ where you can generate an arbitrary join with the following syntax:
490490
.. code-block:: php
491491
492492
<?php
493-
$query = $em->createQuery('SELECT u FROM User u JOIN Banlist b WITH u.email = b.email');
493+
$query = $em->createQuery('SELECT u FROM User u JOIN Banlist b ON u.email = b.email');
494494
495495
With an arbitrary join the result differs from the joins using a mapped property.
496496
The result of an arbitrary join is an one dimensional array with a mix of the entity from the ``SELECT``
@@ -513,13 +513,15 @@ it loads all the related ``Banlist`` objects corresponding to this ``User``. Thi
513513
when the DQL is switched to an arbitrary join.
514514

515515
.. note::
516-
The differences between WHERE, WITH and HAVING clauses may be
516+
The differences between WHERE, WITH, ON and HAVING clauses may be
517517
confusing.
518518

519519
- WHERE is applied to the results of an entire query
520-
- WITH is applied to a join as an additional condition. For
521-
arbitrary joins (SELECT f, b FROM Foo f, Bar b WITH f.id = b.id)
522-
the WITH is required, even if it is 1 = 1
520+
- ON is applied to arbitrary joins as the join condition. For
521+
arbitrary joins (SELECT f, b FROM Foo f, Bar b ON f.id = b.id)
522+
the ON is required, even if it is 1 = 1. WITH is also
523+
supported as alternative keyword for that case for BC reasons.
524+
- WITH is applied to an association join as an addition condition.
523525
- HAVING is applied to the results of a query after
524526
aggregation (GROUP BY)
525527

@@ -1699,9 +1701,14 @@ From, Join and Index by
16991701
SubselectIdentificationVariableDeclaration ::= IdentificationVariableDeclaration
17001702
RangeVariableDeclaration ::= AbstractSchemaName ["AS"] AliasIdentificationVariable
17011703
JoinAssociationDeclaration ::= JoinAssociationPathExpression ["AS"] AliasIdentificationVariable [IndexBy]
1702-
Join ::= ["LEFT" ["OUTER"] | "INNER"] "JOIN" (JoinAssociationDeclaration | RangeVariableDeclaration) ["WITH" ConditionalExpression]
1704+
Join ::= ["LEFT" ["OUTER"] | "INNER"] "JOIN" (JoinAssociationDeclaration ["WITH" ConditionalExpression] | RangeVariableDeclaration [("ON" | "WITH") ConditionalExpression])
17031705
IndexBy ::= "INDEX" "BY" SingleValuedPathExpression
17041706
1707+
.. note::
1708+
Using the ``WITH`` keyword for the ``ConditionalExpression`` of a
1709+
``RangeVariableDeclaration`` is deprecated and will be removed in
1710+
ORM 4.0. Use the ``ON`` keyword instead.
1711+
17051712
Select Expressions
17061713
~~~~~~~~~~~~~~~~~~
17071714

src/Query/Parser.php

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,8 +1609,7 @@ public function SubselectIdentificationVariableDeclaration(): AST\Identification
16091609

16101610
/**
16111611
* Join ::= ["LEFT" ["OUTER"] | "INNER"] "JOIN"
1612-
* (JoinAssociationDeclaration | RangeVariableDeclaration)
1613-
* ["WITH" ConditionalExpression]
1612+
* (JoinAssociationDeclaration ["WITH" ConditionalExpression] | RangeVariableDeclaration [("ON" | "WITH") ConditionalExpression])
16141613
*/
16151614
public function Join(): AST\Join
16161615
{
@@ -1644,22 +1643,32 @@ public function Join(): AST\Join
16441643

16451644
$next = $this->lexer->glimpse();
16461645
assert($next !== null);
1647-
$joinDeclaration = $next->type === TokenType::T_DOT ? $this->JoinAssociationDeclaration() : $this->RangeVariableDeclaration();
1648-
$adhocConditions = $this->lexer->isNextToken(TokenType::T_WITH);
1649-
$join = new AST\Join($joinType, $joinDeclaration);
1646+
$conditionalExpression = null;
16501647

1651-
// Describe non-root join declaration
1652-
if ($joinDeclaration instanceof AST\RangeVariableDeclaration) {
1653-
$joinDeclaration->isRoot = false;
1654-
}
1648+
if ($next->type === TokenType::T_DOT) {
1649+
$joinDeclaration = $this->JoinAssociationDeclaration();
16551650

1656-
// Check for ad-hoc Join conditions
1657-
if ($adhocConditions) {
1658-
$this->match(TokenType::T_WITH);
1651+
if ($this->lexer->isNextToken(TokenType::T_WITH)) {
1652+
$this->match(TokenType::T_WITH);
1653+
$conditionalExpression = $this->ConditionalExpression();
1654+
}
1655+
} else {
1656+
$joinDeclaration = $this->RangeVariableDeclaration();
1657+
$joinDeclaration->isRoot = false;
16591658

1660-
$join->conditionalExpression = $this->ConditionalExpression();
1659+
if ($this->lexer->isNextToken(TokenType::T_ON)) {
1660+
$this->match(TokenType::T_ON);
1661+
$conditionalExpression = $this->ConditionalExpression();
1662+
} elseif ($this->lexer->isNextToken(TokenType::T_WITH)) {
1663+
$this->match(TokenType::T_WITH);
1664+
$conditionalExpression = $this->ConditionalExpression();
1665+
Deprecation::trigger('doctrine/orm', 'https://github.com/doctrine/orm/issues/12192', 'Using WITH for the join condition of arbitrary joins is deprecated. Use ON instead.');
1666+
}
16611667
}
16621668

1669+
$join = new AST\Join($joinType, $joinDeclaration);
1670+
$join->conditionalExpression = $conditionalExpression;
1671+
16631672
return $join;
16641673
}
16651674

src/Query/TokenType.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,5 @@ enum TokenType: int
9090
case T_WHERE = 255;
9191
case T_WITH = 256;
9292
case T_NAMED = 257;
93+
case T_ON = 258;
9394
}

tests/Tests/ORM/Functional/QueryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ public function testToIterableWithMultipleSelectElements(): void
390390
$this->_em->flush();
391391
$this->_em->clear();
392392

393-
$query = $this->_em->createQuery('select a, u from ' . CmsArticle::class . ' a JOIN ' . CmsUser::class . ' u WITH a.user = u');
393+
$query = $this->_em->createQuery('select a, u from ' . CmsArticle::class . ' a JOIN ' . CmsUser::class . ' u ON a.user = u');
394394

395395
$result = iterator_to_array($query->toIterable());
396396

@@ -944,7 +944,7 @@ public function testMultipleJoinComponentsUsingInnerJoin(): void
944944
$query = $this->_em->createQuery('
945945
SELECT u, p
946946
FROM Doctrine\Tests\Models\CMS\CmsUser u
947-
INNER JOIN Doctrine\Tests\Models\CMS\CmsPhonenumber p WITH u = p.user
947+
INNER JOIN Doctrine\Tests\Models\CMS\CmsPhonenumber p ON u = p.user
948948
');
949949
$users = $query->execute();
950950

tests/Tests/ORM/Functional/Ticket/DDC3042Test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function testSQLGenerationDoesNotProvokeAliasCollisions(): void
2828
$this
2929
->_em
3030
->createQuery(
31-
'SELECT f, b FROM ' . __NAMESPACE__ . '\DDC3042Foo f JOIN ' . __NAMESPACE__ . '\DDC3042Bar b WITH 1 = 1',
31+
'SELECT f, b FROM ' . __NAMESPACE__ . '\DDC3042Foo f JOIN ' . __NAMESPACE__ . '\DDC3042Bar b ON 1 = 1',
3232
)
3333
->getSQL(),
3434
);

tests/Tests/ORM/Functional/Ticket/GH6362Test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected function setUp(): void
3939
* SELECT a as base, b, c, d
4040
* FROM Start a
4141
* LEFT JOIN a.bases b
42-
* LEFT JOIN Child c WITH b.id = c.id
42+
* LEFT JOIN Child c ON b.id = c.id
4343
* LEFT JOIN c.joins d
4444
*/
4545
#[Group('GH-6362')]

tests/Tests/ORM/Functional/Ticket/GH6464Test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function testIssue(): void
3939
$query = $this->_em->createQueryBuilder()
4040
->select('p')
4141
->from(GH6464Post::class, 'p')
42-
->innerJoin(GH6464Author::class, 'a', 'WITH', 'p.authorId = a.id')
42+
->innerJoin(GH6464Author::class, 'a', 'ON', 'p.authorId = a.id')
4343
->getQuery();
4444

4545
self::assertDoesNotMatchRegularExpression(

tests/Tests/ORM/Functional/Ticket/GH7496WithToIterableTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ protected function setUp(): void
4040
public function testNonUniqueObjectHydrationDuringIteration(): void
4141
{
4242
$q = $this->_em->createQuery(
43-
'SELECT b FROM ' . GH7496EntityAinB::class . ' aib JOIN ' . GH7496EntityB::class . ' b WITH aib.eB = b',
43+
'SELECT b FROM ' . GH7496EntityAinB::class . ' aib JOIN ' . GH7496EntityB::class . ' b ON aib.eB = b',
4444
);
4545

4646
$bs = IterableTester::iterableToArray(

tests/Tests/ORM/Query/LanguageRecognitionTest.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Doctrine\Tests\ORM\Query;
66

7+
use Doctrine\Deprecations\PHPUnit\VerifyDeprecations;
78
use Doctrine\ORM\AbstractQuery;
89
use Doctrine\ORM\EntityManagerInterface;
910
use Doctrine\ORM\Mapping\Column;
@@ -23,6 +24,8 @@
2324

2425
class LanguageRecognitionTest extends OrmTestCase
2526
{
27+
use VerifyDeprecations;
28+
2629
private EntityManagerInterface $entityManager;
2730
private int $hydrationMode = AbstractQuery::HYDRATE_OBJECT;
2831

@@ -262,8 +265,14 @@ public function testMixingOfJoins(): void
262265
$this->assertValidDQL('SELECT u.name, a.topic, p.phonenumber FROM Doctrine\Tests\Models\CMS\CmsUser u INNER JOIN u.articles a LEFT JOIN u.phonenumbers p');
263266
}
264267

268+
public function testJoinClassPathUsingON(): void
269+
{
270+
$this->assertValidDQL('SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u JOIN Doctrine\Tests\Models\CMS\CmsArticle a ON a.user = u.id');
271+
}
272+
265273
public function testJoinClassPathUsingWITH(): void
266274
{
275+
$this->expectDeprecationWithIdentifier('https://github.com/doctrine/orm/issues/12192');
267276
$this->assertValidDQL('SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u JOIN Doctrine\Tests\Models\CMS\CmsArticle a WITH a.user = u.id');
268277
}
269278

@@ -469,8 +478,14 @@ public function testAllExpressionWithCorrelatedSubquery(): void
469478
$this->assertValidDQL('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id > ALL (SELECT u2.id FROM Doctrine\Tests\Models\CMS\CmsUser u2 WHERE u2.name = u.name)');
470479
}
471480

481+
public function testCustomJoinsAndOnKeywordSupported(): void
482+
{
483+
$this->assertValidDQL('SELECT u, p FROM Doctrine\Tests\Models\CMS\CmsUser u INNER JOIN u.phonenumbers p ON p.phonenumber = 123 WHERE u.id = 1');
484+
}
485+
472486
public function testCustomJoinsAndWithKeywordSupported(): void
473487
{
488+
$this->expectDeprecationWithIdentifier('https://github.com/doctrine/orm/issues/12192');
474489
$this->assertValidDQL('SELECT u, p FROM Doctrine\Tests\Models\CMS\CmsUser u INNER JOIN u.phonenumbers p WITH p.phonenumber = 123 WHERE u.id = 1');
475490
}
476491

@@ -638,7 +653,7 @@ public function testHavingSupportIsNullExpression(): void
638653
#[Group('DDC-3085')]
639654
public function testHavingSupportResultVariableInNullComparisonExpression(): void
640655
{
641-
$this->assertValidDQL('SELECT u AS user, SUM(a.id) AS score FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN Doctrine\Tests\Models\CMS\CmsAddress a WITH a.user = u GROUP BY u HAVING score IS NOT NULL AND score >= 5');
656+
$this->assertValidDQL('SELECT u AS user, SUM(a.id) AS score FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN Doctrine\Tests\Models\CMS\CmsAddress a ON a.user = u GROUP BY u HAVING score IS NOT NULL AND score >= 5');
642657
}
643658

644659
#[Group('DDC-1858')]

tests/Tests/ORM/Query/SelectSqlGenerationTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -191,25 +191,25 @@ public function testSupportsSelectUsingMultipleFromComponents(): void
191191
public function testSupportsJoinOnMultipleComponents(): void
192192
{
193193
$this->assertSqlGeneration(
194-
'SELECT u, p FROM Doctrine\Tests\Models\CMS\CmsUser u JOIN Doctrine\Tests\Models\CMS\CmsPhonenumber p WITH u = p.user',
194+
'SELECT u, p FROM Doctrine\Tests\Models\CMS\CmsUser u JOIN Doctrine\Tests\Models\CMS\CmsPhonenumber p ON u = p.user',
195195
'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c1_.phonenumber AS phonenumber_4, c0_.email_id AS email_id_5, c1_.user_id AS user_id_6 FROM cms_users c0_ INNER JOIN cms_phonenumbers c1_ ON (c0_.id = c1_.user_id)',
196196
);
197197
}
198198

199199
public function testSupportsJoinOnMultipleComponentsWithJoinedInheritanceType(): void
200200
{
201201
$this->assertSqlGeneration(
202-
'SELECT e FROM Doctrine\Tests\Models\Company\CompanyEmployee e JOIN Doctrine\Tests\Models\Company\CompanyManager m WITH e.id = m.id',
202+
'SELECT e FROM Doctrine\Tests\Models\Company\CompanyEmployee e JOIN Doctrine\Tests\Models\Company\CompanyManager m ON e.id = m.id',
203203
'SELECT c0_.id AS id_0, c0_.name AS name_1, c1_.salary AS salary_2, c1_.department AS department_3, c1_.startDate AS startDate_4, c2_.title AS title_5, c0_.discr AS discr_6, c0_.spouse_id AS spouse_id_7, c2_.car_id AS car_id_8 FROM company_employees c1_ INNER JOIN company_persons c0_ ON c1_.id = c0_.id LEFT JOIN company_managers c2_ ON c1_.id = c2_.id INNER JOIN (company_managers c3_ INNER JOIN company_employees c5_ ON c3_.id = c5_.id INNER JOIN company_persons c4_ ON c3_.id = c4_.id) ON (c0_.id = c4_.id)',
204204
);
205205

206206
$this->assertSqlGeneration(
207-
'SELECT e FROM Doctrine\Tests\Models\Company\CompanyEmployee e LEFT JOIN Doctrine\Tests\Models\Company\CompanyManager m WITH e.id = m.id',
207+
'SELECT e FROM Doctrine\Tests\Models\Company\CompanyEmployee e LEFT JOIN Doctrine\Tests\Models\Company\CompanyManager m ON e.id = m.id',
208208
'SELECT c0_.id AS id_0, c0_.name AS name_1, c1_.salary AS salary_2, c1_.department AS department_3, c1_.startDate AS startDate_4, c2_.title AS title_5, c0_.discr AS discr_6, c0_.spouse_id AS spouse_id_7, c2_.car_id AS car_id_8 FROM company_employees c1_ INNER JOIN company_persons c0_ ON c1_.id = c0_.id LEFT JOIN company_managers c2_ ON c1_.id = c2_.id LEFT JOIN (company_managers c3_ INNER JOIN company_employees c5_ ON c3_.id = c5_.id INNER JOIN company_persons c4_ ON c3_.id = c4_.id) ON (c0_.id = c4_.id)',
209209
);
210210

211211
$this->assertSqlGeneration(
212-
'SELECT c FROM Doctrine\Tests\Models\Company\CompanyContract c JOIN c.salesPerson s LEFT JOIN Doctrine\Tests\Models\Company\CompanyEvent e WITH s.id = e.id',
212+
'SELECT c FROM Doctrine\Tests\Models\Company\CompanyContract c JOIN c.salesPerson s LEFT JOIN Doctrine\Tests\Models\Company\CompanyEvent e ON s.id = e.id',
213213
"SELECT c0_.id AS id_0, c0_.completed AS completed_1, c0_.fixPrice AS fixPrice_2, c0_.hoursWorked AS hoursWorked_3, c0_.pricePerHour AS pricePerHour_4, c0_.maxPrice AS maxPrice_5, c0_.discr AS discr_6, c0_.salesPerson_id AS salesPerson_id_7 FROM company_contracts c0_ INNER JOIN company_employees c1_ ON c0_.salesPerson_id = c1_.id LEFT JOIN company_persons c2_ ON c1_.id = c2_.id LEFT JOIN company_managers c3_ ON c1_.id = c3_.id LEFT JOIN (company_events c4_ LEFT JOIN company_auctions c5_ ON c4_.id = c5_.id LEFT JOIN company_raffles c6_ ON c4_.id = c6_.id) ON (c2_.id = c4_.id) WHERE c0_.discr IN ('fix', 'flexible', 'flexultra')",
214214
);
215215
}
@@ -2025,7 +2025,7 @@ public function testSingleTableInheritanceLeftJoinWithCondition(): void
20252025
{
20262026
// Regression test for the bug
20272027
$this->assertSqlGeneration(
2028-
'SELECT c FROM Doctrine\Tests\Models\Company\CompanyEmployee e LEFT JOIN Doctrine\Tests\Models\Company\CompanyContract c WITH c.salesPerson = e.id',
2028+
'SELECT c FROM Doctrine\Tests\Models\Company\CompanyEmployee e LEFT JOIN Doctrine\Tests\Models\Company\CompanyContract c ON c.salesPerson = e.id',
20292029
"SELECT c0_.id AS id_0, c0_.completed AS completed_1, c0_.fixPrice AS fixPrice_2, c0_.hoursWorked AS hoursWorked_3, c0_.pricePerHour AS pricePerHour_4, c0_.maxPrice AS maxPrice_5, c0_.discr AS discr_6, c0_.salesPerson_id AS salesPerson_id_7 FROM company_employees c1_ INNER JOIN company_persons c2_ ON c1_.id = c2_.id LEFT JOIN company_managers c3_ ON c1_.id = c3_.id LEFT JOIN company_contracts c0_ ON (c0_.salesPerson_id = c2_.id) AND c0_.discr IN ('fix', 'flexible', 'flexultra')",
20302030
);
20312031
}
@@ -2035,7 +2035,7 @@ public function testSingleTableInheritanceLeftJoinWithConditionAndWhere(): void
20352035
{
20362036
// Ensure other WHERE predicates are passed through to the main WHERE clause
20372037
$this->assertSqlGeneration(
2038-
'SELECT c FROM Doctrine\Tests\Models\Company\CompanyEmployee e LEFT JOIN Doctrine\Tests\Models\Company\CompanyContract c WITH c.salesPerson = e.id WHERE e.salary > 1000',
2038+
'SELECT c FROM Doctrine\Tests\Models\Company\CompanyEmployee e LEFT JOIN Doctrine\Tests\Models\Company\CompanyContract c ON c.salesPerson = e.id WHERE e.salary > 1000',
20392039
"SELECT c0_.id AS id_0, c0_.completed AS completed_1, c0_.fixPrice AS fixPrice_2, c0_.hoursWorked AS hoursWorked_3, c0_.pricePerHour AS pricePerHour_4, c0_.maxPrice AS maxPrice_5, c0_.discr AS discr_6, c0_.salesPerson_id AS salesPerson_id_7 FROM company_employees c1_ INNER JOIN company_persons c2_ ON c1_.id = c2_.id LEFT JOIN company_managers c3_ ON c1_.id = c3_.id LEFT JOIN company_contracts c0_ ON (c0_.salesPerson_id = c2_.id) AND c0_.discr IN ('fix', 'flexible', 'flexultra') WHERE c1_.salary > 1000",
20402040
);
20412041
}
@@ -2045,7 +2045,7 @@ public function testSingleTableInheritanceInnerJoinWithCondition(): void
20452045
{
20462046
// Test inner joins too
20472047
$this->assertSqlGeneration(
2048-
'SELECT c FROM Doctrine\Tests\Models\Company\CompanyEmployee e INNER JOIN Doctrine\Tests\Models\Company\CompanyContract c WITH c.salesPerson = e.id',
2048+
'SELECT c FROM Doctrine\Tests\Models\Company\CompanyEmployee e INNER JOIN Doctrine\Tests\Models\Company\CompanyContract c ON c.salesPerson = e.id',
20492049
"SELECT c0_.id AS id_0, c0_.completed AS completed_1, c0_.fixPrice AS fixPrice_2, c0_.hoursWorked AS hoursWorked_3, c0_.pricePerHour AS pricePerHour_4, c0_.maxPrice AS maxPrice_5, c0_.discr AS discr_6, c0_.salesPerson_id AS salesPerson_id_7 FROM company_employees c1_ INNER JOIN company_persons c2_ ON c1_.id = c2_.id LEFT JOIN company_managers c3_ ON c1_.id = c3_.id INNER JOIN company_contracts c0_ ON (c0_.salesPerson_id = c2_.id) AND c0_.discr IN ('fix', 'flexible', 'flexultra')",
20502050
);
20512051
}
@@ -2056,7 +2056,7 @@ public function testSingleTableInheritanceLeftJoinNonAssociationWithConditionAnd
20562056
// Test that the discriminator IN() predicate is still added into
20572057
// the where clause when not joining onto that table
20582058
$this->assertSqlGeneration(
2059-
'SELECT c FROM Doctrine\Tests\Models\Company\CompanyContract c LEFT JOIN Doctrine\Tests\Models\Company\CompanyEmployee e WITH e.id = c.salesPerson WHERE c.completed = true',
2059+
'SELECT c FROM Doctrine\Tests\Models\Company\CompanyContract c LEFT JOIN Doctrine\Tests\Models\Company\CompanyEmployee e ON e.id = c.salesPerson WHERE c.completed = true',
20602060
"SELECT c0_.id AS id_0, c0_.completed AS completed_1, c0_.fixPrice AS fixPrice_2, c0_.hoursWorked AS hoursWorked_3, c0_.pricePerHour AS pricePerHour_4, c0_.maxPrice AS maxPrice_5, c0_.discr AS discr_6, c0_.salesPerson_id AS salesPerson_id_7 FROM company_contracts c0_ LEFT JOIN (company_employees c1_ INNER JOIN company_persons c2_ ON c1_.id = c2_.id LEFT JOIN company_managers c3_ ON c1_.id = c3_.id) ON (c2_.id = c0_.salesPerson_id) WHERE (c0_.completed = 1) AND c0_.discr IN ('fix', 'flexible', 'flexultra')",
20612061
);
20622062
}
@@ -2109,7 +2109,7 @@ public function testHavingSupportResultVariableLikeExpression(): void
21092109
public function testHavingSupportResultVariableNullComparisonExpression(): void
21102110
{
21112111
$this->assertSqlGeneration(
2112-
'SELECT u AS user, SUM(a.id) AS score FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN Doctrine\Tests\Models\CMS\CmsAddress a WITH a.user = u GROUP BY u HAVING score IS NOT NULL AND score >= 5',
2112+
'SELECT u AS user, SUM(a.id) AS score FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN Doctrine\Tests\Models\CMS\CmsAddress a ON a.user = u GROUP BY u HAVING score IS NOT NULL AND score >= 5',
21132113
'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, SUM(c1_.id) AS sclr_4, c0_.email_id AS email_id_5 FROM cms_users c0_ LEFT JOIN cms_addresses c1_ ON (c1_.user_id = c0_.id) GROUP BY c0_.id, c0_.status, c0_.username, c0_.name, c0_.email_id HAVING sclr_4 IS NOT NULL AND sclr_4 >= 5',
21142114
);
21152115
}

0 commit comments

Comments
 (0)