diff --git a/phpstan-dbal3.neon b/phpstan-dbal3.neon index ea39e2c3a0b..9f4b42d353f 100644 --- a/phpstan-dbal3.neon +++ b/phpstan-dbal3.neon @@ -8,11 +8,6 @@ parameters: # Symfony cache supports passing a key prefix to the clear method. - '/^Method Psr\\Cache\\CacheItemPoolInterface\:\:clear\(\) invoked with 1 parameter, 0 required\.$/' - # We can be certain that those values are not matched. - - - message: '~^Match expression does not handle remaining values:~' - path: src/Persisters/Entity/BasicEntityPersister.php - # DBAL 4 compatibility - message: '~^Method Doctrine\\ORM\\Query\\AST\\Functions\\TrimFunction::getTrimMode\(\) never returns .* so it can be removed from the return type\.$~' diff --git a/phpstan.neon b/phpstan.neon index f98eb8d00b8..86846e915e0 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -7,15 +7,11 @@ parameters: # Symfony cache supports passing a key prefix to the clear method. - '/^Method Psr\\Cache\\CacheItemPoolInterface\:\:clear\(\) invoked with 1 parameter, 0 required\.$/' - # We can be certain that those values are not matched. - - - message: '~^Match expression does not handle remaining values:~' - path: src/Persisters/Entity/BasicEntityPersister.php - # DBAL 4 compatibility - message: '~^Method Doctrine\\ORM\\Query\\AST\\Functions\\TrimFunction::getTrimMode\(\) never returns .* so it can be removed from the return type\.$~' path: src/Query/AST/Functions/TrimFunction.php + - message: '~^Method Doctrine\\ORM\\Persisters\\Entity\\BasicEntityPersister\:\:getArrayBindingType\(\) never returns .* so it can be removed from the return type\.$~' path: src/Persisters/Entity/BasicEntityPersister.php diff --git a/src/Persisters/Entity/BasicEntityPersister.php b/src/Persisters/Entity/BasicEntityPersister.php index 91b2eaa8832..b722db04642 100644 --- a/src/Persisters/Entity/BasicEntityPersister.php +++ b/src/Persisters/Entity/BasicEntityPersister.php @@ -1929,7 +1929,10 @@ private function getTypes(string $field, mixed $value, ClassMetadata $class): ar return $types; } - /** @phpstan-return ArrayParameterType::* */ + /** + * @psalm-return ArrayParameterType::* + * @throw QueryException˚ + */ private function getArrayBindingType(ParameterType|int|string $type): ArrayParameterType|int { if (! $type instanceof ParameterType) { @@ -1940,6 +1943,8 @@ private function getArrayBindingType(ParameterType|int|string $type): ArrayParam ParameterType::STRING => ArrayParameterType::STRING, ParameterType::INTEGER => ArrayParameterType::INTEGER, ParameterType::ASCII => ArrayParameterType::ASCII, + ParameterType::BINARY => ArrayParameterType::BINARY, + default => throw new QueryException('Unsupported type for array parameter'), }; } diff --git a/tests/Tests/Models/CMS/CmsUser.php b/tests/Tests/Models/CMS/CmsUser.php index d94fa20adc3..785bcde1817 100644 --- a/tests/Tests/Models/CMS/CmsUser.php +++ b/tests/Tests/Models/CMS/CmsUser.php @@ -29,6 +29,10 @@ class CmsUser #[GeneratedValue] public $id; + /** @var string */ + #[Column(type: 'binary', length: 50, nullable: true)] + public $reference; + /** @var string */ #[Column(type: 'string', length: 50, nullable: true)] public $status; diff --git a/tests/Tests/ORM/Functional/NativeQueryTest.php b/tests/Tests/ORM/Functional/NativeQueryTest.php index c9f665387b7..46746c92b67 100644 --- a/tests/Tests/ORM/Functional/NativeQueryTest.php +++ b/tests/Tests/ORM/Functional/NativeQueryTest.php @@ -475,7 +475,7 @@ public function testGenerateSelectClauseNoRenameSingleEntity(): void $selectClause = $rsm->generateSelectClause(); - $this->assertSQLEquals('u.id AS id, u.status AS status, u.username AS username, u.name AS name, u.email_id AS email_id', $selectClause); + $this->assertSQLEquals('u.id AS id, u.reference as reference, u.status AS status, u.username AS username, u.name AS name, u.email_id AS email_id', $selectClause); } #[Group('DDC-2055')] @@ -489,7 +489,7 @@ public function testGenerateSelectClauseCustomRenames(): void $selectClause = $rsm->generateSelectClause(); - $this->assertSQLEquals('u.id AS id1, u.status AS status, u.username AS username2, u.name AS name, u.email_id AS email_id', $selectClause); + $this->assertSQLEquals('u.id AS id1, u.reference as reference, u.status AS status, u.username AS username2, u.name AS name, u.email_id AS email_id', $selectClause); } #[Group('DDC-2055')] @@ -500,7 +500,7 @@ public function testGenerateSelectClauseRenameTableAlias(): void $selectClause = $rsm->generateSelectClause(['u' => 'u1']); - $this->assertSQLEquals('u1.id AS id, u1.status AS status, u1.username AS username, u1.name AS name, u1.email_id AS email_id', $selectClause); + $this->assertSQLEquals('u1.id AS id, u1.reference as reference, u1.status AS status, u1.username AS username, u1.name AS name, u1.email_id AS email_id', $selectClause); } #[Group('DDC-2055')] @@ -511,7 +511,7 @@ public function testGenerateSelectClauseIncrement(): void $selectClause = $rsm->generateSelectClause(); - $this->assertSQLEquals('u.id AS id0, u.status AS status1, u.username AS username2, u.name AS name3, u.email_id AS email_id4', $selectClause); + $this->assertSQLEquals('u.id AS id0, u.reference as reference1, u.status as status2, u.username as username3, u.name as name4, u.email_id as email_id5', $selectClause); } #[Group('DDC-2055')] @@ -520,7 +520,7 @@ public function testGenerateSelectClauseToString(): void $rsm = new ResultSetMappingBuilder($this->_em, ResultSetMappingBuilder::COLUMN_RENAMING_INCREMENT); $rsm->addRootEntityFromClassMetadata(CmsUser::class, 'u'); - $this->assertSQLEquals('u.id AS id0, u.status AS status1, u.username AS username2, u.name AS name3, u.email_id AS email_id4', (string) $rsm); + $this->assertSQLEquals('u.id AS id0, u.reference as reference1, u.status as status2, u.username as username3, u.name as name4, u.email_id as email_id5', (string) $rsm); } #[Group('DDC-3899')] diff --git a/tests/Tests/ORM/Functional/QueryParameterTest.php b/tests/Tests/ORM/Functional/QueryParameterTest.php index e7599cea5ea..8513b4ee781 100644 --- a/tests/Tests/ORM/Functional/QueryParameterTest.php +++ b/tests/Tests/ORM/Functional/QueryParameterTest.php @@ -22,15 +22,18 @@ protected function setUp(): void parent::setUp(); - $user = new CmsUser(); - $user->name = 'John Doe'; - $user->username = 'john'; - $user2 = new CmsUser(); - $user2->name = 'Jane Doe'; - $user2->username = 'jane'; - $user3 = new CmsUser(); - $user3->name = 'Just Bill'; - $user3->username = 'bill'; + $user = new CmsUser(); + $user->reference = '0b0001'; + $user->name = 'John Doe'; + $user->username = 'john'; + $user2 = new CmsUser(); + $user2->reference = '0b0010'; + $user2->name = 'Jane Doe'; + $user2->username = 'jane'; + $user3 = new CmsUser(); + $user3->reference = '0b0011'; + $user3->name = 'Just Bill'; + $user3->username = 'bill'; $this->_em->persist($user); $this->_em->persist($user2); @@ -99,9 +102,9 @@ public function testArrayParameterTypeInBuilder(): void $result = $this->_em->createQueryBuilder() ->from(CmsUser::class, 'u') ->select('u.name') - ->where('u.username IN (:usernames)') + ->where('u.username IN (:values)') ->orderBy('u.username') - ->setParameter('usernames', ['john', 'jane'], ArrayParameterType::STRING) + ->setParameter('values', ['john', 'jane'], ArrayParameterType::STRING) ->getQuery() ->getArrayResult(); @@ -113,10 +116,38 @@ public function testArrayParameterTypeInQuery(): void $result = $this->_em->createQueryBuilder() ->from(CmsUser::class, 'u') ->select('u.name') - ->where('u.username IN (:usernames)') + ->where('u.username IN (:values)') ->orderBy('u.username') ->getQuery() - ->setParameter('usernames', ['john', 'jane'], ArrayParameterType::STRING) + ->setParameter('values', ['john', 'jane'], ArrayParameterType::STRING) + ->getArrayResult(); + + self::assertSame([['name' => 'Jane Doe'], ['name' => 'John Doe']], $result); + } + + public function testArrayParameterTypeBinaryInBuilder(): void + { + $result = $this->_em->createQueryBuilder() + ->from(CmsUser::class, 'u') + ->select('u.name') + ->where('u.reference IN (:values)') + ->orderBy('u.username') + ->setParameter('values', ['0b0001', '0b0010'], ArrayParameterType::BINARY) + ->getQuery() + ->getArrayResult(); + + self::assertSame([['name' => 'Jane Doe'], ['name' => 'John Doe']], $result); + } + + public function testArrayParameterTypeBinaryInQuery(): void + { + $result = $this->_em->createQueryBuilder() + ->from(CmsUser::class, 'u') + ->select('u.name') + ->where('u.reference IN (:values)') + ->orderBy('u.username') + ->getQuery() + ->setParameter('values', ['0b0001', '0b0010'], ArrayParameterType::BINARY) ->getArrayResult(); self::assertSame([['name' => 'Jane Doe'], ['name' => 'John Doe']], $result); diff --git a/tests/Tests/ORM/Functional/SchemaTool/MySqlSchemaToolTest.php b/tests/Tests/ORM/Functional/SchemaTool/MySqlSchemaToolTest.php index cbfc491d654..70a4da088d8 100644 --- a/tests/Tests/ORM/Functional/SchemaTool/MySqlSchemaToolTest.php +++ b/tests/Tests/ORM/Functional/SchemaTool/MySqlSchemaToolTest.php @@ -53,9 +53,9 @@ public function testGetCreateSchemaSql(): void self::assertEquals('CREATE TABLE cms_groups (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(50) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB', $sql[0]); self::assertThat($sql[1], self::logicalOr( // DBAL 3 - self::equalTo('CREATE TABLE cms_users (id INT AUTO_INCREMENT NOT NULL, email_id INT DEFAULT NULL, status VARCHAR(50) DEFAULT NULL, username VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_3AF03EC5F85E0677 (username), UNIQUE INDEX UNIQ_3AF03EC5A832C1C9 (email_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'), + self::equalTo('CREATE TABLE cms_users (id INT AUTO_INCREMENT NOT NULL, email_id INT DEFAULT NULL, reference VARBINARY(50) DEFAULT NULL, status VARCHAR(50) DEFAULT NULL, username VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_3AF03EC5F85E0677 (username), UNIQUE INDEX UNIQ_3AF03EC5A832C1C9 (email_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'), // DBAL 4 (see https://github.com/doctrine/dbal/pull/4777) - self::equalTo('CREATE TABLE cms_users (id INT AUTO_INCREMENT NOT NULL, status VARCHAR(50) DEFAULT NULL, username VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, email_id INT DEFAULT NULL, UNIQUE INDEX UNIQ_3AF03EC5F85E0677 (username), UNIQUE INDEX UNIQ_3AF03EC5A832C1C9 (email_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'), + self::equalTo('CREATE TABLE cms_users (id INT AUTO_INCREMENT NOT NULL, reference VARBINARY(50) DEFAULT NULL, status VARCHAR(50) DEFAULT NULL, username VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, email_id INT DEFAULT NULL, UNIQUE INDEX UNIQ_3AF03EC5F85E0677 (username), UNIQUE INDEX UNIQ_3AF03EC5A832C1C9 (email_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'), )); self::assertEquals('CREATE TABLE cms_users_groups (user_id INT NOT NULL, group_id INT NOT NULL, INDEX IDX_7EA9409AA76ED395 (user_id), INDEX IDX_7EA9409AFE54D947 (group_id), PRIMARY KEY(user_id, group_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB', $sql[2]); self::assertEquals('CREATE TABLE cms_users_tags (user_id INT NOT NULL, tag_id INT NOT NULL, INDEX IDX_93F5A1ADA76ED395 (user_id), INDEX IDX_93F5A1ADBAD26311 (tag_id), PRIMARY KEY(user_id, tag_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB', $sql[3]); diff --git a/tests/Tests/ORM/Query/CustomTreeWalkersJoinTest.php b/tests/Tests/ORM/Query/CustomTreeWalkersJoinTest.php index 16be0ce6ff3..914bec4d7c6 100644 --- a/tests/Tests/ORM/Query/CustomTreeWalkersJoinTest.php +++ b/tests/Tests/ORM/Query/CustomTreeWalkersJoinTest.php @@ -37,7 +37,7 @@ public function testAddsJoin(): void { $this->assertSqlGeneration( 'select u from Doctrine\Tests\Models\CMS\CmsUser u', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c1_.id AS id_4, c1_.country AS country_5, c1_.zip AS zip_6, c1_.city AS city_7, c0_.email_id AS email_id_8, c1_.user_id AS user_id_9 FROM cms_users c0_ LEFT JOIN cms_addresses c1_ ON c0_.id = c1_.user_id', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c1_.id AS id_5, c1_.country AS country_6, c1_.zip AS zip_7, c1_.city AS city_8, c0_.email_id AS email_id_9, c1_.user_id AS user_id_10 FROM cms_users c0_ LEFT JOIN cms_addresses c1_ ON c0_.id = c1_.user_id', ); } diff --git a/tests/Tests/ORM/Query/CustomTreeWalkersTest.php b/tests/Tests/ORM/Query/CustomTreeWalkersTest.php index 83e001fbdcd..999f14fb7b7 100644 --- a/tests/Tests/ORM/Query/CustomTreeWalkersTest.php +++ b/tests/Tests/ORM/Query/CustomTreeWalkersTest.php @@ -74,7 +74,7 @@ public function testSupportsQueriesWithoutWhere(): void { $this->assertSqlGeneration( 'select u from Doctrine\Tests\Models\CMS\CmsUser u', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE c0_.id = 1', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE c0_.id = 1', [CustomTreeWalker::class], ); } @@ -83,7 +83,7 @@ public function testSupportsQueriesWithMultipleConditionalExpressions(): void { $this->assertSqlGeneration( 'select u from Doctrine\Tests\Models\CMS\CmsUser u where u.name = :name or u.name = :otherName', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE (c0_.name = ? OR c0_.name = ?) AND c0_.id = 1', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE (c0_.name = ? OR c0_.name = ?) AND c0_.id = 1', [CustomTreeWalker::class], ); } @@ -92,7 +92,7 @@ public function testSupportsQueriesWithSimpleConditionalExpression(): void { $this->assertSqlGeneration( 'select u from Doctrine\Tests\Models\CMS\CmsUser u where u.name = :name', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE c0_.name = ? AND c0_.id = 1', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE c0_.name = ? AND c0_.id = 1', [CustomTreeWalker::class], ); } @@ -113,7 +113,7 @@ public function testSupportsSeveralHintsQueries(): void { $this->assertSqlGeneration( 'select u from Doctrine\Tests\Models\CMS\CmsUser u', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c1_.id AS id_4, c1_.country AS country_5, c1_.zip AS zip_6, c1_.city AS city_7, c0_.email_id AS email_id_8, c1_.user_id AS user_id_9 FROM cms_users c0_ LEFT JOIN cms_addresses c1_ ON c0_.id = c1_.user_id WHERE c0_.id = 1', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c1_.id AS id_5, c1_.country AS country_6, c1_.zip AS zip_7, c1_.city AS city_8, c0_.email_id AS email_id_9, c1_.user_id AS user_id_10 FROM cms_users c0_ LEFT JOIN cms_addresses c1_ ON c0_.id = c1_.user_id WHERE c0_.id = 1', [CustomTreeWalkerJoin::class, CustomTreeWalker::class], ); } diff --git a/tests/Tests/ORM/Query/SelectSqlGenerationTest.php b/tests/Tests/ORM/Query/SelectSqlGenerationTest.php index 02c4921c54f..679b3c008f1 100644 --- a/tests/Tests/ORM/Query/SelectSqlGenerationTest.php +++ b/tests/Tests/ORM/Query/SelectSqlGenerationTest.php @@ -136,7 +136,7 @@ public function testSupportsSelectForAllFields(): void { $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_', ); } @@ -168,7 +168,7 @@ public function testNotExistsExpression(): void { $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE NOT EXISTS (SELECT p.phonenumber FROM Doctrine\Tests\Models\CMS\CmsPhonenumber p WHERE p.phonenumber = 1234)', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE NOT EXISTS (SELECT c1_.phonenumber FROM cms_phonenumbers c1_ WHERE c1_.phonenumber = 1234)', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE NOT EXISTS (SELECT c1_.phonenumber FROM cms_phonenumbers c1_ WHERE c1_.phonenumber = 1234)', ); } @@ -184,7 +184,7 @@ public function testSupportsSelectUsingMultipleFromComponents(): void { $this->assertSqlGeneration( 'SELECT u, p FROM Doctrine\Tests\Models\CMS\CmsUser u, Doctrine\Tests\Models\CMS\CmsPhonenumber p WHERE u = p.user', - '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_, cms_phonenumbers c1_ WHERE c0_.id = c1_.user_id', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c1_.phonenumber AS phonenumber_5, c0_.email_id AS email_id_6, c1_.user_id AS user_id_7 FROM cms_users c0_, cms_phonenumbers c1_ WHERE c0_.id = c1_.user_id', ); } @@ -192,7 +192,7 @@ public function testSupportsJoinOnMultipleComponents(): void { $this->assertSqlGeneration( 'SELECT u, p FROM Doctrine\Tests\Models\CMS\CmsUser u JOIN Doctrine\Tests\Models\CMS\CmsPhonenumber p WITH u = p.user', - '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)', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c1_.phonenumber AS phonenumber_5, c0_.email_id AS email_id_6, c1_.user_id AS user_id_7 FROM cms_users c0_ INNER JOIN cms_phonenumbers c1_ ON (c0_.id = c1_.user_id)', ); } @@ -218,7 +218,7 @@ public function testSupportsSelectWithCollectionAssociationJoin(): void { $this->assertSqlGeneration( 'SELECT u, p FROM Doctrine\Tests\Models\CMS\CmsUser u JOIN u.phonenumbers p', - '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', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c1_.phonenumber AS phonenumber_5, c0_.email_id AS email_id_6, c1_.user_id AS user_id_7 FROM cms_users c0_ INNER JOIN cms_phonenumbers c1_ ON c0_.id = c1_.user_id', ); } @@ -386,7 +386,7 @@ public function testSupportsArithmeticExpressionsInWherePart(): void { $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE ((u.id + 5000) * u.id + 3) < 10000000', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE ((c0_.id + 5000) * c0_.id + 3) < 10000000', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE ((c0_.id + 5000) * c0_.id + 3) < 10000000', ); } @@ -394,7 +394,7 @@ public function testSupportsMultipleEntitiesInFromClause(): void { $this->assertSqlGeneration( 'SELECT u, a FROM Doctrine\Tests\Models\CMS\CmsUser u, Doctrine\Tests\Models\CMS\CmsArticle a JOIN a.user u2 WHERE u.id = u2.id', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c1_.id AS id_4, c1_.topic AS topic_5, c1_.text AS text_6, c1_.version AS version_7, c0_.email_id AS email_id_8, c1_.user_id AS user_id_9 FROM cms_users c0_, cms_articles c1_ INNER JOIN cms_users c2_ ON c1_.user_id = c2_.id WHERE c0_.id = c2_.id', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c1_.id AS id_5, c1_.topic AS topic_6, c1_.text AS text_7, c1_.version AS version_8, c0_.email_id AS email_id_9, c1_.user_id AS user_id_10 FROM cms_users c0_, cms_articles c1_ INNER JOIN cms_users c2_ ON c1_.user_id = c2_.id WHERE c0_.id = c2_.id', ); } @@ -402,7 +402,7 @@ public function testSupportsMultipleEntitiesInFromClauseUsingPathExpression(): v { $this->assertSqlGeneration( 'SELECT u, a FROM Doctrine\Tests\Models\CMS\CmsUser u, Doctrine\Tests\Models\CMS\CmsArticle a WHERE u.id = a.user', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c1_.id AS id_4, c1_.topic AS topic_5, c1_.text AS text_6, c1_.version AS version_7, c0_.email_id AS email_id_8, c1_.user_id AS user_id_9 FROM cms_users c0_, cms_articles c1_ WHERE c0_.id = c1_.user_id', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c1_.id AS id_5, c1_.topic AS topic_6, c1_.text AS text_7, c1_.version AS version_8, c0_.email_id AS email_id_9, c1_.user_id AS user_id_10 FROM cms_users c0_, cms_articles c1_ WHERE c0_.id = c1_.user_id', ); } @@ -423,11 +423,11 @@ public function testSupportsJoinAndWithClauseRestriction(): void { $this->assertSqlGeneration( "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.articles a WITH a.topic LIKE '%foo%'", - "SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ LEFT JOIN cms_articles c1_ ON c0_.id = c1_.user_id AND (c1_.topic LIKE '%foo%')", + "SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ LEFT JOIN cms_articles c1_ ON c0_.id = c1_.user_id AND (c1_.topic LIKE '%foo%')", ); $this->assertSqlGeneration( "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u INNER JOIN u.articles a WITH a.topic LIKE '%foo%'", - "SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ INNER JOIN cms_articles c1_ ON c0_.id = c1_.user_id AND (c1_.topic LIKE '%foo%')", + "SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ INNER JOIN cms_articles c1_ ON c0_.id = c1_.user_id AND (c1_.topic LIKE '%foo%')", ); } @@ -569,7 +569,7 @@ public function testSupportsMultipleValuedInExpressionInWherePart(): void { $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id IN (1, 2)', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE c0_.id IN (1, 2)', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE c0_.id IN (1, 2)', ); } @@ -577,7 +577,7 @@ public function testSupportsNotInExpressionInWherePart(): void { $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE :id NOT IN (1)', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE ? NOT IN (1)', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE ? NOT IN (1)', ); } @@ -658,7 +658,7 @@ public function testSubqueriesInComparisonExpression(): void { $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE (u.id >= (SELECT u2.id FROM Doctrine\Tests\Models\CMS\CmsUser u2 WHERE u2.name = :name)) AND (u.id <= (SELECT u3.id FROM Doctrine\Tests\Models\CMS\CmsUser u3 WHERE u3.name = :name))', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE (c0_.id >= (SELECT c1_.id FROM cms_users c1_ WHERE c1_.name = ?)) AND (c0_.id <= (SELECT c2_.id FROM cms_users c2_ WHERE c2_.name = ?))', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE (c0_.id >= (SELECT c1_.id FROM cms_users c1_ WHERE c1_.name = ?)) AND (c0_.id <= (SELECT c2_.id FROM cms_users c2_ WHERE c2_.name = ?))', ); } @@ -765,8 +765,8 @@ public function testSupportsCurrentTimestampFunction(): void public function testExistsExpressionInWhereCorrelatedSubqueryAssocCondition(): void { $this->assertSqlGeneration( - // DQL - // The result of this query consists of all employees whose spouses are also employees. + // DQL + // The result of this query consists of all employees whose spouses are also employees. 'SELECT DISTINCT emp FROM Doctrine\Tests\Models\CMS\CmsEmployee emp WHERE EXISTS ( SELECT spouseEmp @@ -780,8 +780,8 @@ public function testExistsExpressionInWhereCorrelatedSubqueryAssocCondition(): v public function testExistsExpressionWithSimpleSelectReturningScalar(): void { $this->assertSqlGeneration( - // DQL - // The result of this query consists of all employees whose spouses are also employees. + // DQL + // The result of this query consists of all employees whose spouses are also employees. 'SELECT DISTINCT emp FROM Doctrine\Tests\Models\CMS\CmsEmployee emp WHERE EXISTS ( SELECT 1 @@ -798,7 +798,7 @@ public function testLimitFromQueryClass(): void ->createQuery('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u') ->setMaxResults(10); - self::assertEquals('SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ LIMIT 10', $q->getSql()); + self::assertEquals('SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ LIMIT 10', $q->getSql()); } public function testLimitAndOffsetFromQueryClass(): void @@ -812,8 +812,8 @@ public function testLimitAndOffsetFromQueryClass(): void self::assertThat( $q->getSql(), self::logicalOr( - self::identicalTo('SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ LIMIT 10'), - self::identicalTo('SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ LIMIT 10 OFFSET 0'), + self::identicalTo('SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ LIMIT 10'), + self::identicalTo('SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ LIMIT 10 OFFSET 0'), ), ); } @@ -822,7 +822,7 @@ public function testSizeFunction(): void { $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE SIZE(u.phonenumbers) > 1', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE (SELECT COUNT(*) FROM cms_phonenumbers c1_ WHERE c1_.user_id = c0_.id) > 1', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE (SELECT COUNT(*) FROM cms_phonenumbers c1_ WHERE c1_.user_id = c0_.id) > 1', ); } @@ -830,7 +830,7 @@ public function testSizeFunctionSupportsManyToMany(): void { $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE SIZE(u.groups) > 1', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE (SELECT COUNT(*) FROM cms_users_groups c1_ WHERE c1_.user_id = c0_.id) > 1', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE (SELECT COUNT(*) FROM cms_users_groups c1_ WHERE c1_.user_id = c0_.id) > 1', ); } @@ -838,11 +838,11 @@ public function testEmptyCollectionComparisonExpression(): void { $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.phonenumbers IS EMPTY', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE (SELECT COUNT(*) FROM cms_phonenumbers c1_ WHERE c1_.user_id = c0_.id) = 0', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE (SELECT COUNT(*) FROM cms_phonenumbers c1_ WHERE c1_.user_id = c0_.id) = 0', ); $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.phonenumbers IS NOT EMPTY', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE (SELECT COUNT(*) FROM cms_phonenumbers c1_ WHERE c1_.user_id = c0_.id) > 0', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE (SELECT COUNT(*) FROM cms_phonenumbers c1_ WHERE c1_.user_id = c0_.id) > 0', ); } @@ -850,7 +850,7 @@ public function testNestedExpressions(): void { $this->assertSqlGeneration( 'select u from Doctrine\Tests\Models\CMS\CmsUser u where u.id > 10 and u.id < 42 and ((u.id * 2) > 5)', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE c0_.id > 10 AND c0_.id < 42 AND ((c0_.id * 2) > 5)', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE c0_.id > 10 AND c0_.id < 42 AND ((c0_.id * 2) > 5)', ); } @@ -858,7 +858,7 @@ public function testNestedExpressions2(): void { $this->assertSqlGeneration( 'select u from Doctrine\Tests\Models\CMS\CmsUser u where (u.id > 10) and (u.id < 42 and ((u.id * 2) > 5)) or u.id <> 42', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE (c0_.id > 10) AND (c0_.id < 42 AND ((c0_.id * 2) > 5)) OR c0_.id <> 42', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE (c0_.id > 10) AND (c0_.id < 42 AND ((c0_.id * 2) > 5)) OR c0_.id <> 42', ); } @@ -866,7 +866,7 @@ public function testNestedExpressions3(): void { $this->assertSqlGeneration( 'select u from Doctrine\Tests\Models\CMS\CmsUser u where (u.id > 10) and (u.id between 1 and 10 or u.id in (1, 2, 3, 4, 5))', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE (c0_.id > 10) AND (c0_.id BETWEEN 1 AND 10 OR c0_.id IN (1, 2, 3, 4, 5))', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE (c0_.id > 10) AND (c0_.id BETWEEN 1 AND 10 OR c0_.id IN (1, 2, 3, 4, 5))', ); } @@ -874,7 +874,7 @@ public function testOrderByCollectionAssociationSize(): void { $this->assertSqlGeneration( 'select u, size(u.articles) as numArticles from Doctrine\Tests\Models\CMS\CmsUser u order by numArticles', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, (SELECT COUNT(*) FROM cms_articles c1_ WHERE c1_.user_id = c0_.id) AS sclr_4, c0_.email_id AS email_id_5 FROM cms_users c0_ ORDER BY sclr_4 ASC', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, (SELECT COUNT(*) FROM cms_articles c1_ WHERE c1_.user_id = c0_.id) AS sclr_5, c0_.email_id AS email_id_6 FROM cms_users c0_ ORDER BY sclr_5 ASC', ); } @@ -946,7 +946,7 @@ public function testSingleValuedAssociationNullCheckOnInverseSide(): void { $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.address a WHERE a.id IS NULL', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ LEFT JOIN cms_addresses c1_ ON c0_.id = c1_.user_id WHERE c1_.id IS NULL', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ LEFT JOIN cms_addresses c1_ ON c0_.id = c1_.user_id WHERE c1_.id IS NULL', ); } @@ -978,7 +978,7 @@ public function testStringFunctionLikeExpression(): void ); $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.articles a WITH a.topic LIKE u.name', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ LEFT JOIN cms_articles c1_ ON c0_.id = c1_.user_id AND (c1_.topic LIKE c0_.name)', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ LEFT JOIN cms_articles c1_ ON c0_.id = c1_.user_id AND (c1_.topic LIKE c0_.name)', ); } @@ -996,7 +996,7 @@ public function testStringFunctionNotLikeExpression(): void ); $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.articles a WITH a.topic NOT LIKE u.name', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ LEFT JOIN cms_articles c1_ ON c0_.id = c1_.user_id AND (c1_.topic NOT LIKE c0_.name)', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ LEFT JOIN cms_articles c1_ ON c0_.id = c1_.user_id AND (c1_.topic NOT LIKE c0_.name)', ); } @@ -1027,7 +1027,7 @@ public function testPessimisticWriteLockQueryHint(): void $this->assertSqlGeneration( "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.username = 'gblanco'", - "SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE c0_.username = 'gblanco' FOR UPDATE", + "SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE c0_.username = 'gblanco' FOR UPDATE", [ORMQuery::HINT_LOCK_MODE => LockMode::PESSIMISTIC_WRITE], ); } @@ -1040,7 +1040,7 @@ public function testPessimisticReadLockQueryHintPostgreSql(): void $this->assertSqlGeneration( "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.username = 'gblanco'", - "SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE c0_.username = 'gblanco' FOR SHARE", + "SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE c0_.username = 'gblanco' FOR SHARE", [ORMQuery::HINT_LOCK_MODE => LockMode::PESSIMISTIC_READ], ); } @@ -1051,7 +1051,7 @@ public function testLockModeNoneQueryHint(): void { $this->assertSqlGeneration( "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.username = 'gblanco'", - "SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE c0_.username = 'gblanco'", + "SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE c0_.username = 'gblanco'", [ORMQuery::HINT_LOCK_MODE => LockMode::NONE], ); } @@ -1061,7 +1061,7 @@ public function testSupportSelectWithMoreThan10InputParameters(): void { $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = ?1 OR u.id = ?2 OR u.id = ?3 OR u.id = ?4 OR u.id = ?5 OR u.id = ?6 OR u.id = ?7 OR u.id = ?8 OR u.id = ?9 OR u.id = ?10 OR u.id = ?11', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE c0_.id = ? OR c0_.id = ? OR c0_.id = ? OR c0_.id = ? OR c0_.id = ? OR c0_.id = ? OR c0_.id = ? OR c0_.id = ? OR c0_.id = ? OR c0_.id = ? OR c0_.id = ?', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE c0_.id = ? OR c0_.id = ? OR c0_.id = ? OR c0_.id = ? OR c0_.id = ? OR c0_.id = ? OR c0_.id = ? OR c0_.id = ? OR c0_.id = ? OR c0_.id = ? OR c0_.id = ?', ); } @@ -1073,7 +1073,7 @@ public function testPessimisticReadLockQueryHintMySql(): void $this->assertSqlGeneration( "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.username = 'gblanco'", - "SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE c0_.username = 'gblanco' LOCK IN SHARE MODE", + "SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE c0_.username = 'gblanco' LOCK IN SHARE MODE", [ORMQuery::HINT_LOCK_MODE => LockMode::PESSIMISTIC_READ], ); } @@ -1086,7 +1086,7 @@ public function testPessimisticReadLockQueryHintOracle(): void $this->assertSqlGeneration( "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.username = 'gblanco'", - "SELECT c0_.id AS ID_0, c0_.status AS STATUS_1, c0_.username AS USERNAME_2, c0_.name AS NAME_3, c0_.email_id AS EMAIL_ID_4 FROM cms_users c0_ WHERE c0_.username = 'gblanco' FOR UPDATE", + "SELECT c0_.id AS ID_0, c0_.reference AS REFERENCE_1, c0_.status AS STATUS_2, c0_.username AS USERNAME_3, c0_.name AS NAME_4, c0_.email_id AS EMAIL_ID_5 FROM cms_users c0_ WHERE c0_.username = 'gblanco' FOR UPDATE", [ORMQuery::HINT_LOCK_MODE => LockMode::PESSIMISTIC_READ], ); } @@ -1178,7 +1178,7 @@ public function testSubSelectAliasesFromOuterQuery(): void { $this->assertSqlGeneration( 'SELECT uo, (SELECT ui.name FROM Doctrine\Tests\Models\CMS\CmsUser ui WHERE ui.id = uo.id) AS bar FROM Doctrine\Tests\Models\CMS\CmsUser uo', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, (SELECT c1_.name FROM cms_users c1_ WHERE c1_.id = c0_.id) AS sclr_4, c0_.email_id AS email_id_5 FROM cms_users c0_', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, (SELECT c1_.name FROM cms_users c1_ WHERE c1_.id = c0_.id) AS sclr_5, c0_.email_id AS email_id_6 FROM cms_users c0_', ); } @@ -1186,7 +1186,7 @@ public function testSubSelectAliasesFromOuterQueryWithSubquery(): void { $this->assertSqlGeneration( 'SELECT uo, (SELECT ui.name FROM Doctrine\Tests\Models\CMS\CmsUser ui WHERE ui.id = uo.id AND ui.name IN (SELECT uii.name FROM Doctrine\Tests\Models\CMS\CmsUser uii)) AS bar FROM Doctrine\Tests\Models\CMS\CmsUser uo', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, (SELECT c1_.name FROM cms_users c1_ WHERE c1_.id = c0_.id AND c1_.name IN (SELECT c2_.name FROM cms_users c2_)) AS sclr_4, c0_.email_id AS email_id_5 FROM cms_users c0_', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, (SELECT c1_.name FROM cms_users c1_ WHERE c1_.id = c0_.id AND c1_.name IN (SELECT c2_.name FROM cms_users c2_)) AS sclr_5, c0_.email_id AS email_id_6 FROM cms_users c0_', ); } @@ -1194,7 +1194,7 @@ public function testSubSelectAliasesFromOuterQueryReuseInWhereClause(): void { $this->assertSqlGeneration( 'SELECT uo, (SELECT ui.name FROM Doctrine\Tests\Models\CMS\CmsUser ui WHERE ui.id = uo.id) AS bar FROM Doctrine\Tests\Models\CMS\CmsUser uo WHERE bar = ?0', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, (SELECT c1_.name FROM cms_users c1_ WHERE c1_.id = c0_.id) AS sclr_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE sclr_4 = ?', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, (SELECT c1_.name FROM cms_users c1_ WHERE c1_.id = c0_.id) AS sclr_5, c0_.email_id AS email_id_6 FROM cms_users c0_ WHERE sclr_5 = ?', ); } @@ -1550,12 +1550,12 @@ public function testSelectWithArithmeticExpressionBeforeField(): void ); } - #[Group('DDC-1430')] + #[Group('DDC-1430')] public function testGroupByAllFieldsWhenObjectHasForeignKeys(): void { $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u GROUP BY u', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ GROUP BY c0_.id, c0_.status, c0_.username, c0_.name, c0_.email_id', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ GROUP BY c0_.id, c0_.reference, c0_.status, c0_.username, c0_.name, c0_.email_id', ); $this->assertSqlGeneration( @@ -1569,7 +1569,7 @@ public function testGroupBySupportsResultVariable(): void { $this->assertSqlGeneration( 'SELECT u, u.status AS st FROM Doctrine\Tests\Models\CMS\CmsUser u GROUP BY st', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.status AS status_4, c0_.email_id AS email_id_5 FROM cms_users c0_ GROUP BY c0_.status', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.status AS status_5, c0_.email_id AS email_id_6 FROM cms_users c0_ GROUP BY c0_.status', ); } @@ -1578,7 +1578,7 @@ public function testGroupBySupportsIdentificationVariable(): void { $this->assertSqlGeneration( 'SELECT u AS user FROM Doctrine\Tests\Models\CMS\CmsUser u GROUP BY user', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ GROUP BY id_0, status_1, username_2, name_3', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ GROUP BY id_0, reference_1, status_2, username_3, name_4', ); } @@ -1587,7 +1587,7 @@ public function testSupportsBitComparison(): void { $this->assertSqlGeneration( 'SELECT BIT_OR(4,2), BIT_AND(4,2), u FROM Doctrine\Tests\Models\CMS\CmsUser u', - 'SELECT (4 | 2) AS sclr_0, (4 & 2) AS sclr_1, c0_.id AS id_2, c0_.status AS status_3, c0_.username AS username_4, c0_.name AS name_5, c0_.email_id AS email_id_6 FROM cms_users c0_', + 'SELECT (4 | 2) AS sclr_0, (4 & 2) AS sclr_1, c0_.id AS id_2, c0_.reference AS reference_3, c0_.status AS status_4, c0_.username AS username_5, c0_.name AS name_6, c0_.email_id AS email_id_7 FROM cms_users c0_', ); $this->assertSqlGeneration( 'SELECT BIT_OR(u.id,2), BIT_AND(u.id,2) FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE BIT_OR(u.id,2) > 0', @@ -1608,15 +1608,15 @@ public function testParenthesesOnTheLeftHandOfComparison(): void { $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u where ( (u.id + u.id) * u.id ) > 100', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE ((c0_.id + c0_.id) * c0_.id) > 100', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE ((c0_.id + c0_.id) * c0_.id) > 100', ); $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u where (u.id + u.id) * u.id > 100', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE (c0_.id + c0_.id) * c0_.id > 100', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE (c0_.id + c0_.id) * c0_.id > 100', ); $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u where 100 < (u.id + u.id) * u.id ', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE 100 < (c0_.id + c0_.id) * c0_.id', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE 100 < (c0_.id + c0_.id) * c0_.id', ); } @@ -1633,27 +1633,27 @@ public function testSupportsSubSqlFunction(): void { $this->assertSqlGeneration( 'SELECT u1 FROM Doctrine\Tests\Models\CMS\CmsUser u1 WHERE u1.name IN ( SELECT TRIM(u2.name) FROM Doctrine\Tests\Models\CMS\CmsUser u2 )', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE c0_.name IN (SELECT TRIM(c1_.name) AS sclr_5 FROM cms_users c1_)', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE c0_.name IN (SELECT TRIM(c1_.name) AS sclr_6 FROM cms_users c1_)', ); $this->assertSqlGeneration( 'SELECT u1 FROM Doctrine\Tests\Models\CMS\CmsUser u1 WHERE u1.name IN ( SELECT TRIM(u2.name) FROM Doctrine\Tests\Models\CMS\CmsUser u2 WHERE LOWER(u2.name) LIKE \'%fabio%\')', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE c0_.name IN (SELECT TRIM(c1_.name) AS sclr_5 FROM cms_users c1_ WHERE LOWER(c1_.name) LIKE \'%fabio%\')', + "SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE c0_.name IN (SELECT TRIM(c1_.name) AS sclr_6 FROM cms_users c1_ WHERE LOWER(c1_.name) LIKE '%fabio%')", ); $this->assertSqlGeneration( 'SELECT u1 FROM Doctrine\Tests\Models\CMS\CmsUser u1 WHERE u1.email IN ( SELECT TRIM(IDENTITY(u2.email)) FROM Doctrine\Tests\Models\CMS\CmsUser u2 )', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE c0_.email_id IN (SELECT TRIM(c1_.email_id) AS sclr_5 FROM cms_users c1_)', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE c0_.email_id IN (SELECT TRIM(c1_.email_id) AS sclr_6 FROM cms_users c1_)', ); $this->assertSqlGeneration( 'SELECT u1 FROM Doctrine\Tests\Models\CMS\CmsUser u1 WHERE u1.email IN ( SELECT IDENTITY(u2.email) FROM Doctrine\Tests\Models\CMS\CmsUser u2 )', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE c0_.email_id IN (SELECT c1_.email_id AS sclr_5 FROM cms_users c1_)', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE c0_.email_id IN (SELECT c1_.email_id AS sclr_6 FROM cms_users c1_)', ); $this->assertSqlGeneration( 'SELECT u1 FROM Doctrine\Tests\Models\CMS\CmsUser u1 WHERE COUNT(u1.id) = ( SELECT SUM(u2.id) FROM Doctrine\Tests\Models\CMS\CmsUser u2 )', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE COUNT(c0_.id) = (SELECT SUM(c1_.id) AS sclr_5 FROM cms_users c1_)', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE COUNT(c0_.id) = (SELECT SUM(c1_.id) AS sclr_6 FROM cms_users c1_)', ); $this->assertSqlGeneration( 'SELECT u1 FROM Doctrine\Tests\Models\CMS\CmsUser u1 WHERE COUNT(u1.id) <= ( SELECT SUM(u2.id) + COUNT(u2.email) FROM Doctrine\Tests\Models\CMS\CmsUser u2 )', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE COUNT(c0_.id) <= (SELECT SUM(c1_.id) + COUNT(c1_.email_id) AS sclr_5 FROM cms_users c1_)', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE COUNT(c0_.id) <= (SELECT SUM(c1_.id) + COUNT(c1_.email_id) AS sclr_6 FROM cms_users c1_)', ); } @@ -1696,37 +1696,37 @@ public function testWhereFunctionIsNullComparisonExpression(): void { $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE IDENTITY(u.email) IS NULL', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE c0_.email_id IS NULL', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE c0_.email_id IS NULL', ); $this->assertSqlGeneration( "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE NULLIF(u.name, 'FabioBatSilva') IS NULL AND IDENTITY(u.email) IS NOT NULL", - "SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE NULLIF(c0_.name, 'FabioBatSilva') IS NULL AND c0_.email_id IS NOT NULL", + "SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE NULLIF(c0_.name, 'FabioBatSilva') IS NULL AND c0_.email_id IS NOT NULL", ); $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE IDENTITY(u.email) IS NOT NULL', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE c0_.email_id IS NOT NULL', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE c0_.email_id IS NOT NULL', ); $this->assertSqlGeneration( "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE NULLIF(u.name, 'FabioBatSilva') IS NOT NULL", - "SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE NULLIF(c0_.name, 'FabioBatSilva') IS NOT NULL", + "SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE NULLIF(c0_.name, 'FabioBatSilva') IS NOT NULL", ); $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE COALESCE(u.name, u.id) IS NOT NULL', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE COALESCE(c0_.name, c0_.id) IS NOT NULL', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE COALESCE(c0_.name, c0_.id) IS NOT NULL', ); $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE COALESCE(u.id, IDENTITY(u.email)) IS NOT NULL', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE COALESCE(c0_.id, c0_.email_id) IS NOT NULL', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE COALESCE(c0_.id, c0_.email_id) IS NOT NULL', ); $this->assertSqlGeneration( "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE COALESCE(IDENTITY(u.email), NULLIF(u.name, 'FabioBatSilva')) IS NOT NULL", - "SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ WHERE COALESCE(c0_.email_id, NULLIF(c0_.name, 'FabioBatSilva')) IS NOT NULL", + "SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ WHERE COALESCE(c0_.email_id, NULLIF(c0_.name, 'FabioBatSilva')) IS NOT NULL", ); } @@ -1800,15 +1800,15 @@ public function testOrderByClauseSupportsSimpleArithmeticExpression(): void { $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u ORDER BY u.id + 1 ', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ ORDER BY c0_.id + 1 ASC', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ ORDER BY c0_.id + 1 ASC', ); $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u ORDER BY ( ( (u.id + 1) * (u.id - 1) ) / 2)', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ ORDER BY (((c0_.id + 1) * (c0_.id - 1)) / 2) ASC', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ ORDER BY (((c0_.id + 1) * (c0_.id - 1)) / 2) ASC', ); $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u ORDER BY ((u.id + 5000) * u.id + 3) ', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ ORDER BY ((c0_.id + 5000) * c0_.id + 3) ASC', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ ORDER BY ((c0_.id + 5000) * c0_.id + 3) ASC', ); } @@ -1816,7 +1816,7 @@ public function testOrderByClauseSupportsFunction(): void { $this->assertSqlGeneration( 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u ORDER BY CONCAT(u.username, u.name) ', - 'SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ ORDER BY c0_.username || c0_.name ASC', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, c0_.email_id AS email_id_5 FROM cms_users c0_ ORDER BY c0_.username || c0_.name ASC', ); } @@ -1956,7 +1956,7 @@ public function testSupportsMoreThanTwoParametersInConcatFunction(): void ); } - #[Group('DDC-2188')] + #[Group('DDC-2188')] public function testArithmeticPriority(): void { $this->assertSqlGeneration( @@ -2102,7 +2102,7 @@ public function testHavingSupportResultVariableNullComparisonExpression(): void { $this->assertSqlGeneration( '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', - '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', + 'SELECT c0_.id AS id_0, c0_.reference AS reference_1, c0_.status AS status_2, c0_.username AS username_3, c0_.name AS name_4, SUM(c1_.id) AS sclr_5, c0_.email_id AS email_id_6 FROM cms_users c0_ LEFT JOIN cms_addresses c1_ ON (c1_.user_id = c0_.id) GROUP BY c0_.id, c0_.reference, c0_.status, c0_.username, c0_.name, c0_.email_id HAVING sclr_5 IS NOT NULL AND sclr_5 >= 5', ); } @@ -2157,6 +2157,7 @@ public function parse(Parser $parser): void $parser->match(TokenType::T_CLOSE_PARENTHESIS); } } + #[Entity] class DDC1384Model {