Skip to content

Commit

Permalink
Merge pull request #6420 from greg0ire/4.1.x
Browse files Browse the repository at this point in the history
Merge 3.9.x up into 4.1.x
  • Loading branch information
greg0ire authored Jun 2, 2024
2 parents eb80c04 + 83d5a7f commit 0ceaf0c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Platforms/Keywords/MySQL84Keywords.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Doctrine\DBAL\Platforms\Keywords;

use function array_diff;
use function array_merge;

/**
Expand All @@ -14,12 +15,19 @@ class MySQL84Keywords extends MySQL80Keywords
/**
* {@inheritDoc}
*
* @link https://dev.mysql.com/doc/refman/8.4/en/keywords.html#keywords-new-in-current-series
* @link https://dev.mysql.com/doc/refman/8.4/en/keywords.html
*/
protected function getKeywords(): array
{
$keywords = parent::getKeywords();

// Removed Keywords and Reserved Words
$keywords = array_diff($keywords, [
'MASTER_BIND',
'MASTER_SSL_VERIFY_SERVER_CERT',
]);

// New Keywords and Reserved Words
$keywords = array_merge($keywords, [
'AUTO',
'BERNOULLI',
Expand Down
25 changes: 25 additions & 0 deletions tests/Platforms/MySQL84PlatformTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

declare(strict_types=1);

namespace Doctrine\DBAL\Tests\Platforms;

use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\MySQL84Platform;

class MySQL84PlatformTest extends MySQLPlatformTest
{
public function createPlatform(): AbstractPlatform
{
return new MySQL84Platform();
}

public function testMySQL84KeywordList(): void
{
$keywordList = $this->platform->getReservedKeywordsList();

self::assertTrue($keywordList->isKeyword('persist'));
self::assertTrue($keywordList->isKeyword('manual'));
self::assertFalse($keywordList->isKeyword('master_bind'));
}
}

0 comments on commit 0ceaf0c

Please sign in to comment.