Skip to content

Commit

Permalink
Rebase 3.8.0 from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
dsentker committed Jan 26, 2024
1 parent e02e8d6 commit 1941c39
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Platforms/MariaDb1043Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Doctrine\DBAL\Platforms;

use Doctrine\DBAL\Exception\InvalidArgumentException;
use Doctrine\DBAL\Types\JsonType;
use Doctrine\Deprecations\Deprecation;

Expand Down Expand Up @@ -92,6 +93,11 @@ public function getColumnTypeSQLSnippet(string $tableAlias = 'c', ?string $datab
);
}

// 't' alias is already in use for following query
if ($tableAlias === 't') {
throw new InvalidArgumentException('Table alias "t" is not allowed, please choose another one.');

Check warning on line 98 in src/Platforms/MariaDb1043Platform.php

View check run for this annotation

Codecov / codecov/patch

src/Platforms/MariaDb1043Platform.php#L98

Added line #L98 was not covered by tests
}

$databaseName = $this->getDatabaseNameSQL($databaseName);

// The check for `CONSTRAINT_SCHEMA = $databaseName` is mandatory here to prevent performance issues
Expand All @@ -102,7 +108,7 @@ public function getColumnTypeSQLSnippet(string $tableAlias = 'c', ?string $datab
SELECT * from information_schema.CHECK_CONSTRAINTS t
WHERE t.CONSTRAINT_SCHEMA = $databaseName
AND t.TABLE_NAME = $tableAlias.TABLE_NAME
AND CHECK_CLAUSE = CONCAT(
AND t.CHECK_CLAUSE = CONCAT(
'json_valid(`',
$tableAlias.COLUMN_NAME,
'`)'
Expand Down

0 comments on commit 1941c39

Please sign in to comment.