-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: #6146 - utf8/utf8mb3 alias causes redundant ALTER TABLE changes
- Loading branch information
1 parent
7fb00fd
commit 83f4788
Showing
14 changed files
with
250 additions
and
8 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
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
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
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
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
29 changes: 29 additions & 0 deletions
29
tests/Platforms/MySQL/CollationMetadataProvider/ConnectionCharsetMetadataProviderTest.php
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,29 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\DBAL\Tests\Platforms\MySQL\CollationMetadataProvider; | ||
|
||
use Doctrine\DBAL\Connection; | ||
use Doctrine\DBAL\Platforms\MySQL\CharsetMetadataProvider\ConnectionCharsetMetadataProvider; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class ConnectionCharsetMetadataProviderTest extends TestCase | ||
{ | ||
public function testNormalizeCharset(): void | ||
{ | ||
$connection = $this->createMock(Connection::class); | ||
|
||
$utf8Provider = new ConnectionCharsetMetadataProvider($connection, false); | ||
|
||
self::assertSame('utf8', $utf8Provider->normalizeCharset('utf8')); | ||
self::assertSame('utf8', $utf8Provider->normalizeCharset('utf8mb3')); | ||
self::assertSame('foobar', $utf8Provider->normalizeCharset('foobar')); | ||
|
||
$utf8mb3Provider = new ConnectionCharsetMetadataProvider($connection, true); | ||
|
||
self::assertSame('utf8mb3', $utf8mb3Provider->normalizeCharset('utf8')); | ||
self::assertSame('utf8mb3', $utf8mb3Provider->normalizeCharset('utf8mb3')); | ||
self::assertSame('foobar', $utf8mb3Provider->normalizeCharset('foobar')); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
tests/Platforms/MySQL/CollationMetadataProvider/ConnectionCollationMetadataProviderTest.php
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,29 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\DBAL\Tests\Platforms\MySQL\CollationMetadataProvider; | ||
|
||
use Doctrine\DBAL\Connection; | ||
use Doctrine\DBAL\Platforms\MySQL\CollationMetadataProvider\ConnectionCollationMetadataProvider; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class ConnectionCollationMetadataProviderTest extends TestCase | ||
{ | ||
public function testNormalizeCcollation(): void | ||
{ | ||
$connection = $this->createMock(Connection::class); | ||
|
||
$utf8Provider = new ConnectionCollationMetadataProvider($connection, false); | ||
|
||
self::assertSame('utf8_unicode_ci', $utf8Provider->normalizeCollation('utf8_unicode_ci')); | ||
self::assertSame('utf8_unicode_ci', $utf8Provider->normalizeCollation('utf8mb3_unicode_ci')); | ||
self::assertSame('foobar_unicode_ci', $utf8Provider->normalizeCollation('foobar_unicode_ci')); | ||
|
||
$utf8mb3Provider = new ConnectionCollationMetadataProvider($connection, true); | ||
|
||
self::assertSame('utf8mb3_unicode_ci', $utf8mb3Provider->normalizeCollation('utf8_unicode_ci')); | ||
self::assertSame('utf8mb3_unicode_ci', $utf8mb3Provider->normalizeCollation('utf8mb3_unicode_ci')); | ||
self::assertSame('foobar_unicode_ci', $utf8mb3Provider->normalizeCollation('foobar_unicode_ci')); | ||
} | ||
} |
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