Skip to content

Commit

Permalink
Merge pull request #6485 from doctrine/3.8.x
Browse files Browse the repository at this point in the history
Merge 3.8.x up into 3.9.x
  • Loading branch information
greg0ire authored Aug 7, 2024
2 parents 1874323 + 2093d67 commit 613798a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ jobs:
MSSQL_COLLATION: "${{ matrix.collation }}"

options: >-
--health-cmd "echo quit | /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -l 1 -U sa -P Doctrine2018"
--health-cmd "echo quit | /opt/mssql-tools18/bin/sqlcmd -C -S 127.0.0.1 -l 1 -U sa -P Doctrine2018"
ports:
- "1433:1433"
Expand Down
8 changes: 8 additions & 0 deletions src/Schema/AbstractSchemaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -1740,6 +1740,10 @@ public function getSchemaSearchPaths()
*/
public function extractDoctrineTypeFromComment($comment, $currentType)
{
if ($this->_conn->getConfiguration()->getDisableTypeComments()) {
return $currentType;
}

if ($comment !== null && preg_match('(\(DC2Type:(((?!\)).)+)\))', $comment, $match) === 1) {
return $match[1];
}
Expand All @@ -1757,6 +1761,10 @@ public function extractDoctrineTypeFromComment($comment, $currentType)
*/
public function removeDoctrineTypeFromComment($comment, $type)
{
if ($this->_conn->getConfiguration()->getDisableTypeComments()) {
return $comment;
}

if ($comment === null) {
return null;
}
Expand Down
8 changes: 7 additions & 1 deletion tests/Functional/Ticket/DBAL461Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Doctrine\DBAL\Tests\Functional\Ticket;

use Doctrine\DBAL\Configuration;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Platforms\SQLServer2012Platform;
use Doctrine\DBAL\Schema\SQLServerSchemaManager;
Expand All @@ -14,7 +15,12 @@ class DBAL461Test extends TestCase
{
public function testIssue(): void
{
$conn = $this->createMock(Connection::class);
$configuration = $this->createStub(Configuration::class);
$configuration->method('getDisableTypeComments')->willReturn(false);

$conn = $this->createMock(Connection::class);
$conn->method('getConfiguration')->willReturn($configuration);

$platform = new SQLServer2012Platform();
$platform->registerDoctrineTypeMapping('numeric', Types::DECIMAL);

Expand Down

0 comments on commit 613798a

Please sign in to comment.