Skip to content

Commit 7d67d25

Browse files
authored
MySQL 8.4 removed keywords (#6408)
1 parent 9631339 commit 7d67d25

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

src/Platforms/Keywords/MySQL84Keywords.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Doctrine\DBAL\Platforms\Keywords;
46

57
use Doctrine\Deprecations\Deprecation;
68

9+
use function array_diff;
710
use function array_merge;
811

912
/**
@@ -30,12 +33,19 @@ public function getName()
3033
/**
3134
* {@inheritDoc}
3235
*
33-
* @link https://dev.mysql.com/doc/refman/8.4/en/keywords.html#keywords-new-in-current-series
36+
* @link https://dev.mysql.com/doc/refman/8.4/en/keywords.html
3437
*/
3538
protected function getKeywords()
3639
{
3740
$keywords = parent::getKeywords();
3841

42+
// Removed Keywords and Reserved Words
43+
$keywords = array_diff($keywords, [
44+
'MASTER_BIND',
45+
'MASTER_SSL_VERIFY_SERVER_CERT',
46+
]);
47+
48+
// New Keywords and Reserved Words
3949
$keywords = array_merge($keywords, [
4050
'AUTO',
4151
'BERNOULLI',
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Doctrine\DBAL\Tests\Platforms;
6+
7+
use Doctrine\DBAL\Platforms\AbstractPlatform;
8+
use Doctrine\DBAL\Platforms\Keywords\KeywordList;
9+
use Doctrine\DBAL\Platforms\MySQL84Platform;
10+
11+
class MySQL84PlatformTest extends MySQL57PlatformTest
12+
{
13+
public function createPlatform(): AbstractPlatform
14+
{
15+
return new MySQL84Platform();
16+
}
17+
18+
public function testMySQL84KeywordList(): void
19+
{
20+
$keywordList = $this->platform->getReservedKeywordsList();
21+
self::assertInstanceOf(KeywordList::class, $keywordList);
22+
23+
self::assertTrue($keywordList->isKeyword('persist'));
24+
self::assertTrue($keywordList->isKeyword('manual'));
25+
self::assertFalse($keywordList->isKeyword('master_bind'));
26+
}
27+
}

0 commit comments

Comments
 (0)