зеркало из https://github.com/nextcloud/3rdparty.git
build: Update doctrine/dbal from 3.8.x to 3.9.1
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Родитель
9e36079193
Коммит
3ca0c47a84
|
@ -23,7 +23,7 @@
|
|||
"cweagans/composer-patches": "^1.7",
|
||||
"deepdiver/zipstreamer": "^2.0.3",
|
||||
"deepdiver1975/tarstreamer": "^2.1.0",
|
||||
"doctrine/dbal": "^3.7.0",
|
||||
"doctrine/dbal": "^3.9.1",
|
||||
"egulias/email-validator": "^4.0.2",
|
||||
"fusonic/opengraph": "^2.3.0",
|
||||
"giggsey/libphonenumber-for-php-lite": "^8.13.12",
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "b9af8f022789889a84b87cb841809891",
|
||||
"content-hash": "77af81de2820f02808ad54a25fc1be22",
|
||||
"packages": [
|
||||
{
|
||||
"name": "aws/aws-crt-php",
|
||||
|
@ -525,16 +525,16 @@
|
|||
},
|
||||
{
|
||||
"name": "doctrine/dbal",
|
||||
"version": "3.8.3",
|
||||
"version": "3.9.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/dbal.git",
|
||||
"reference": "db922ba9436b7b18a23d1653a0b41ff2369ca41c"
|
||||
"reference": "d7dc08f98cba352b2bab5d32c5e58f7e745c11a7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/dbal/zipball/db922ba9436b7b18a23d1653a0b41ff2369ca41c",
|
||||
"reference": "db922ba9436b7b18a23d1653a0b41ff2369ca41c",
|
||||
"url": "https://api.github.com/repos/doctrine/dbal/zipball/d7dc08f98cba352b2bab5d32c5e58f7e745c11a7",
|
||||
"reference": "d7dc08f98cba352b2bab5d32c5e58f7e745c11a7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -550,12 +550,12 @@
|
|||
"doctrine/coding-standard": "12.0.0",
|
||||
"fig/log-test": "^1",
|
||||
"jetbrains/phpstorm-stubs": "2023.1",
|
||||
"phpstan/phpstan": "1.10.58",
|
||||
"phpstan/phpstan-strict-rules": "^1.5",
|
||||
"phpunit/phpunit": "9.6.16",
|
||||
"phpstan/phpstan": "1.12.0",
|
||||
"phpstan/phpstan-strict-rules": "^1.6",
|
||||
"phpunit/phpunit": "9.6.20",
|
||||
"psalm/plugin-phpunit": "0.18.4",
|
||||
"slevomat/coding-standard": "8.13.1",
|
||||
"squizlabs/php_codesniffer": "3.9.0",
|
||||
"squizlabs/php_codesniffer": "3.10.2",
|
||||
"symfony/cache": "^5.4|^6.0|^7.0",
|
||||
"symfony/console": "^4.4|^5.4|^6.0|^7.0",
|
||||
"vimeo/psalm": "4.30.0"
|
||||
|
@ -618,7 +618,7 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/doctrine/dbal/issues",
|
||||
"source": "https://github.com/doctrine/dbal/tree/3.8.3"
|
||||
"source": "https://github.com/doctrine/dbal/tree/3.9.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -634,7 +634,7 @@
|
|||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-03-03T15:55:06+00:00"
|
||||
"time": "2024-09-01T13:49:23+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/deprecations",
|
||||
|
|
|
@ -1425,6 +1425,7 @@ return array(
|
|||
'Doctrine\\DBAL\\Platforms\\Keywords\\MariaDb102Keywords' => $vendorDir . '/doctrine/dbal/src/Platforms/Keywords/MariaDb102Keywords.php',
|
||||
'Doctrine\\DBAL\\Platforms\\Keywords\\MySQL57Keywords' => $vendorDir . '/doctrine/dbal/src/Platforms/Keywords/MySQL57Keywords.php',
|
||||
'Doctrine\\DBAL\\Platforms\\Keywords\\MySQL80Keywords' => $vendorDir . '/doctrine/dbal/src/Platforms/Keywords/MySQL80Keywords.php',
|
||||
'Doctrine\\DBAL\\Platforms\\Keywords\\MySQL84Keywords' => $vendorDir . '/doctrine/dbal/src/Platforms/Keywords/MySQL84Keywords.php',
|
||||
'Doctrine\\DBAL\\Platforms\\Keywords\\MySQLKeywords' => $vendorDir . '/doctrine/dbal/src/Platforms/Keywords/MySQLKeywords.php',
|
||||
'Doctrine\\DBAL\\Platforms\\Keywords\\OracleKeywords' => $vendorDir . '/doctrine/dbal/src/Platforms/Keywords/OracleKeywords.php',
|
||||
'Doctrine\\DBAL\\Platforms\\Keywords\\PostgreSQL100Keywords' => $vendorDir . '/doctrine/dbal/src/Platforms/Keywords/PostgreSQL100Keywords.php',
|
||||
|
@ -1435,12 +1436,14 @@ return array(
|
|||
'Doctrine\\DBAL\\Platforms\\Keywords\\SQLServerKeywords' => $vendorDir . '/doctrine/dbal/src/Platforms/Keywords/SQLServerKeywords.php',
|
||||
'Doctrine\\DBAL\\Platforms\\Keywords\\SQLiteKeywords' => $vendorDir . '/doctrine/dbal/src/Platforms/Keywords/SQLiteKeywords.php',
|
||||
'Doctrine\\DBAL\\Platforms\\MariaDBPlatform' => $vendorDir . '/doctrine/dbal/src/Platforms/MariaDBPlatform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\MariaDb1010Platform' => $vendorDir . '/doctrine/dbal/src/Platforms/MariaDb1010Platform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\MariaDb1027Platform' => $vendorDir . '/doctrine/dbal/src/Platforms/MariaDb1027Platform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\MariaDb1043Platform' => $vendorDir . '/doctrine/dbal/src/Platforms/MariaDb1043Platform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\MariaDb1052Platform' => $vendorDir . '/doctrine/dbal/src/Platforms/MariaDb1052Platform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\MariaDb1060Platform' => $vendorDir . '/doctrine/dbal/src/Platforms/MariaDb1060Platform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\MySQL57Platform' => $vendorDir . '/doctrine/dbal/src/Platforms/MySQL57Platform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\MySQL80Platform' => $vendorDir . '/doctrine/dbal/src/Platforms/MySQL80Platform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\MySQL84Platform' => $vendorDir . '/doctrine/dbal/src/Platforms/MySQL84Platform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\MySQLPlatform' => $vendorDir . '/doctrine/dbal/src/Platforms/MySQLPlatform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\MySQL\\CollationMetadataProvider' => $vendorDir . '/doctrine/dbal/src/Platforms/MySQL/CollationMetadataProvider.php',
|
||||
'Doctrine\\DBAL\\Platforms\\MySQL\\CollationMetadataProvider\\CachingCollationMetadataProvider' => $vendorDir . '/doctrine/dbal/src/Platforms/MySQL/CollationMetadataProvider/CachingCollationMetadataProvider.php',
|
||||
|
@ -1448,6 +1451,7 @@ return array(
|
|||
'Doctrine\\DBAL\\Platforms\\MySQL\\Comparator' => $vendorDir . '/doctrine/dbal/src/Platforms/MySQL/Comparator.php',
|
||||
'Doctrine\\DBAL\\Platforms\\OraclePlatform' => $vendorDir . '/doctrine/dbal/src/Platforms/OraclePlatform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\PostgreSQL100Platform' => $vendorDir . '/doctrine/dbal/src/Platforms/PostgreSQL100Platform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\PostgreSQL120Platform' => $vendorDir . '/doctrine/dbal/src/Platforms/PostgreSQL120Platform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\PostgreSQL94Platform' => $vendorDir . '/doctrine/dbal/src/Platforms/PostgreSQL94Platform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\PostgreSQLPlatform' => $vendorDir . '/doctrine/dbal/src/Platforms/PostgreSQLPlatform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\SQLServer2012Platform' => $vendorDir . '/doctrine/dbal/src/Platforms/SQLServer2012Platform.php',
|
||||
|
|
|
@ -1958,6 +1958,7 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652
|
|||
'Doctrine\\DBAL\\Platforms\\Keywords\\MariaDb102Keywords' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/Keywords/MariaDb102Keywords.php',
|
||||
'Doctrine\\DBAL\\Platforms\\Keywords\\MySQL57Keywords' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/Keywords/MySQL57Keywords.php',
|
||||
'Doctrine\\DBAL\\Platforms\\Keywords\\MySQL80Keywords' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/Keywords/MySQL80Keywords.php',
|
||||
'Doctrine\\DBAL\\Platforms\\Keywords\\MySQL84Keywords' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/Keywords/MySQL84Keywords.php',
|
||||
'Doctrine\\DBAL\\Platforms\\Keywords\\MySQLKeywords' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/Keywords/MySQLKeywords.php',
|
||||
'Doctrine\\DBAL\\Platforms\\Keywords\\OracleKeywords' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/Keywords/OracleKeywords.php',
|
||||
'Doctrine\\DBAL\\Platforms\\Keywords\\PostgreSQL100Keywords' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/Keywords/PostgreSQL100Keywords.php',
|
||||
|
@ -1968,12 +1969,14 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652
|
|||
'Doctrine\\DBAL\\Platforms\\Keywords\\SQLServerKeywords' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/Keywords/SQLServerKeywords.php',
|
||||
'Doctrine\\DBAL\\Platforms\\Keywords\\SQLiteKeywords' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/Keywords/SQLiteKeywords.php',
|
||||
'Doctrine\\DBAL\\Platforms\\MariaDBPlatform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/MariaDBPlatform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\MariaDb1010Platform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/MariaDb1010Platform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\MariaDb1027Platform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/MariaDb1027Platform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\MariaDb1043Platform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/MariaDb1043Platform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\MariaDb1052Platform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/MariaDb1052Platform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\MariaDb1060Platform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/MariaDb1060Platform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\MySQL57Platform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/MySQL57Platform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\MySQL80Platform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/MySQL80Platform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\MySQL84Platform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/MySQL84Platform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\MySQLPlatform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/MySQLPlatform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\MySQL\\CollationMetadataProvider' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/MySQL/CollationMetadataProvider.php',
|
||||
'Doctrine\\DBAL\\Platforms\\MySQL\\CollationMetadataProvider\\CachingCollationMetadataProvider' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/MySQL/CollationMetadataProvider/CachingCollationMetadataProvider.php',
|
||||
|
@ -1981,6 +1984,7 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652
|
|||
'Doctrine\\DBAL\\Platforms\\MySQL\\Comparator' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/MySQL/Comparator.php',
|
||||
'Doctrine\\DBAL\\Platforms\\OraclePlatform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/OraclePlatform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\PostgreSQL100Platform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/PostgreSQL100Platform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\PostgreSQL120Platform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/PostgreSQL120Platform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\PostgreSQL94Platform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/PostgreSQL94Platform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\PostgreSQLPlatform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/PostgreSQLPlatform.php',
|
||||
'Doctrine\\DBAL\\Platforms\\SQLServer2012Platform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/SQLServer2012Platform.php',
|
||||
|
|
|
@ -543,17 +543,17 @@
|
|||
},
|
||||
{
|
||||
"name": "doctrine/dbal",
|
||||
"version": "3.8.3",
|
||||
"version_normalized": "3.8.3.0",
|
||||
"version": "3.9.1",
|
||||
"version_normalized": "3.9.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/dbal.git",
|
||||
"reference": "db922ba9436b7b18a23d1653a0b41ff2369ca41c"
|
||||
"reference": "d7dc08f98cba352b2bab5d32c5e58f7e745c11a7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/dbal/zipball/db922ba9436b7b18a23d1653a0b41ff2369ca41c",
|
||||
"reference": "db922ba9436b7b18a23d1653a0b41ff2369ca41c",
|
||||
"url": "https://api.github.com/repos/doctrine/dbal/zipball/d7dc08f98cba352b2bab5d32c5e58f7e745c11a7",
|
||||
"reference": "d7dc08f98cba352b2bab5d32c5e58f7e745c11a7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -569,12 +569,12 @@
|
|||
"doctrine/coding-standard": "12.0.0",
|
||||
"fig/log-test": "^1",
|
||||
"jetbrains/phpstorm-stubs": "2023.1",
|
||||
"phpstan/phpstan": "1.10.58",
|
||||
"phpstan/phpstan-strict-rules": "^1.5",
|
||||
"phpunit/phpunit": "9.6.16",
|
||||
"phpstan/phpstan": "1.12.0",
|
||||
"phpstan/phpstan-strict-rules": "^1.6",
|
||||
"phpunit/phpunit": "9.6.20",
|
||||
"psalm/plugin-phpunit": "0.18.4",
|
||||
"slevomat/coding-standard": "8.13.1",
|
||||
"squizlabs/php_codesniffer": "3.9.0",
|
||||
"squizlabs/php_codesniffer": "3.10.2",
|
||||
"symfony/cache": "^5.4|^6.0|^7.0",
|
||||
"symfony/console": "^4.4|^5.4|^6.0|^7.0",
|
||||
"vimeo/psalm": "4.30.0"
|
||||
|
@ -582,7 +582,7 @@
|
|||
"suggest": {
|
||||
"symfony/console": "For helpful console commands such as SQL execution and import of files."
|
||||
},
|
||||
"time": "2024-03-03T15:55:06+00:00",
|
||||
"time": "2024-09-01T13:49:23+00:00",
|
||||
"bin": [
|
||||
"bin/doctrine-dbal"
|
||||
],
|
||||
|
@ -639,7 +639,7 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/doctrine/dbal/issues",
|
||||
"source": "https://github.com/doctrine/dbal/tree/3.8.3"
|
||||
"source": "https://github.com/doctrine/dbal/tree/3.9.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
|
|
@ -83,9 +83,9 @@
|
|||
'dev_requirement' => false,
|
||||
),
|
||||
'doctrine/dbal' => array(
|
||||
'pretty_version' => '3.8.3',
|
||||
'version' => '3.8.3.0',
|
||||
'reference' => 'db922ba9436b7b18a23d1653a0b41ff2369ca41c',
|
||||
'pretty_version' => '3.9.1',
|
||||
'version' => '3.9.1.0',
|
||||
'reference' => 'd7dc08f98cba352b2bab5d32c5e58f7e745c11a7',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../doctrine/dbal',
|
||||
'aliases' => array(),
|
||||
|
|
|
@ -1317,10 +1317,6 @@ class Connection
|
|||
throw ConnectionException::mayNotAlterNestedTransactionWithSavepointsInTransaction();
|
||||
}
|
||||
|
||||
if (! $this->getDatabasePlatform()->supportsSavepoints()) {
|
||||
throw ConnectionException::savepointsNotSupported();
|
||||
}
|
||||
|
||||
$this->nestTransactionsWithSavepoints = (bool) $nestTransactionsWithSavepoints;
|
||||
}
|
||||
|
||||
|
|
|
@ -101,6 +101,7 @@ final class ExceptionConverter implements ExceptionConverterInterface
|
|||
return new ConnectionException($exception, $query);
|
||||
|
||||
case 2006:
|
||||
case 4031:
|
||||
return new ConnectionLost($exception, $query);
|
||||
|
||||
case 1048:
|
||||
|
|
|
@ -87,7 +87,7 @@ abstract class AbstractDB2Driver implements VersionAwarePlatformDriver
|
|||
'/^(?:[^\s]+\s)?(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)/i',
|
||||
$versionString,
|
||||
$versionParts,
|
||||
) === 0
|
||||
) !== 1
|
||||
) {
|
||||
throw DBALException::invalidPlatformVersionSpecified(
|
||||
$versionString,
|
||||
|
|
|
@ -8,12 +8,14 @@ use Doctrine\DBAL\Driver\API\MySQL;
|
|||
use Doctrine\DBAL\Exception;
|
||||
use Doctrine\DBAL\Platforms\AbstractMySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use Doctrine\DBAL\Platforms\MariaDb1010Platform;
|
||||
use Doctrine\DBAL\Platforms\MariaDb1027Platform;
|
||||
use Doctrine\DBAL\Platforms\MariaDb1043Platform;
|
||||
use Doctrine\DBAL\Platforms\MariaDb1052Platform;
|
||||
use Doctrine\DBAL\Platforms\MariaDb1060Platform;
|
||||
use Doctrine\DBAL\Platforms\MySQL57Platform;
|
||||
use Doctrine\DBAL\Platforms\MySQL80Platform;
|
||||
use Doctrine\DBAL\Platforms\MySQL84Platform;
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Schema\MySQLSchemaManager;
|
||||
use Doctrine\DBAL\VersionAwarePlatformDriver;
|
||||
|
@ -40,6 +42,10 @@ abstract class AbstractMySQLDriver implements VersionAwarePlatformDriver
|
|||
|
||||
if ($mariadb) {
|
||||
$mariaDbVersion = $this->getMariaDbMysqlVersionNumber($version);
|
||||
if (version_compare($mariaDbVersion, '10.10.0', '>=')) {
|
||||
return new MariaDb1010Platform();
|
||||
}
|
||||
|
||||
if (version_compare($mariaDbVersion, '10.6.0', '>=')) {
|
||||
return new MariaDb1060Platform();
|
||||
}
|
||||
|
@ -64,6 +70,20 @@ abstract class AbstractMySQLDriver implements VersionAwarePlatformDriver
|
|||
}
|
||||
} else {
|
||||
$oracleMysqlVersion = $this->getOracleMysqlVersionNumber($version);
|
||||
|
||||
if (version_compare($oracleMysqlVersion, '8.4.0', '>=')) {
|
||||
if (! version_compare($version, '8.4.0', '>=')) {
|
||||
Deprecation::trigger(
|
||||
'doctrine/orm',
|
||||
'https://github.com/doctrine/dbal/pull/5779',
|
||||
'Version detection logic for MySQL will change in DBAL 4. '
|
||||
. 'Please specify the version as the server reports it, e.g. "8.4.0" instead of "8.4".',
|
||||
);
|
||||
}
|
||||
|
||||
return new MySQL84Platform();
|
||||
}
|
||||
|
||||
if (version_compare($oracleMysqlVersion, '8', '>=')) {
|
||||
if (! version_compare($version, '8.0.0', '>=')) {
|
||||
Deprecation::trigger(
|
||||
|
@ -116,7 +136,7 @@ abstract class AbstractMySQLDriver implements VersionAwarePlatformDriver
|
|||
'/^(?P<major>\d+)(?:\.(?P<minor>\d+)(?:\.(?P<patch>\d+))?)?/',
|
||||
$versionString,
|
||||
$versionParts,
|
||||
) === 0
|
||||
) !== 1
|
||||
) {
|
||||
throw Exception::invalidPlatformVersionSpecified(
|
||||
$versionString,
|
||||
|
@ -130,6 +150,8 @@ abstract class AbstractMySQLDriver implements VersionAwarePlatformDriver
|
|||
|
||||
if ($majorVersion === '5' && $minorVersion === '7') {
|
||||
$patchVersion ??= '9';
|
||||
} else {
|
||||
$patchVersion ??= '0';
|
||||
}
|
||||
|
||||
return $majorVersion . '.' . $minorVersion . '.' . $patchVersion;
|
||||
|
@ -160,7 +182,7 @@ abstract class AbstractMySQLDriver implements VersionAwarePlatformDriver
|
|||
'/^(?:5\.5\.5-)?(mariadb-)?(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)/i',
|
||||
$versionString,
|
||||
$versionParts,
|
||||
) === 0
|
||||
) !== 1
|
||||
) {
|
||||
throw Exception::invalidPlatformVersionSpecified(
|
||||
$versionString,
|
||||
|
|
|
@ -8,6 +8,7 @@ use Doctrine\DBAL\Driver\API\PostgreSQL;
|
|||
use Doctrine\DBAL\Exception;
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQL100Platform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQL120Platform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Schema\PostgreSQLSchemaManager;
|
||||
|
@ -28,7 +29,7 @@ abstract class AbstractPostgreSQLDriver implements VersionAwarePlatformDriver
|
|||
*/
|
||||
public function createDatabasePlatformForVersion($version)
|
||||
{
|
||||
if (preg_match('/^(?P<major>\d+)(?:\.(?P<minor>\d+)(?:\.(?P<patch>\d+))?)?/', $version, $versionParts) === 0) {
|
||||
if (preg_match('/^(?P<major>\d+)(?:\.(?P<minor>\d+)(?:\.(?P<patch>\d+))?)?/', $version, $versionParts) !== 1) {
|
||||
throw Exception::invalidPlatformVersionSpecified(
|
||||
$version,
|
||||
'<major_version>.<minor_version>.<patch_version>',
|
||||
|
@ -40,6 +41,10 @@ abstract class AbstractPostgreSQLDriver implements VersionAwarePlatformDriver
|
|||
$patchVersion = $versionParts['patch'] ?? 0;
|
||||
$version = $majorVersion . '.' . $minorVersion . '.' . $patchVersion;
|
||||
|
||||
if (version_compare($version, '12.0', '>=')) {
|
||||
return new PostgreSQL120Platform();
|
||||
}
|
||||
|
||||
if (version_compare($version, '10.0', '>=')) {
|
||||
return new PostgreSQL100Platform();
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ class InitializeSession implements Middleware
|
|||
'ALTER SESSION SET'
|
||||
. " NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'"
|
||||
. " NLS_TIME_FORMAT = 'HH24:MI:SS'"
|
||||
. " NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'"
|
||||
. " NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS'"
|
||||
. " NLS_TIMESTAMP_TZ_FORMAT = 'YYYY-MM-DD HH24:MI:SS TZH:TZM'"
|
||||
. " NLS_NUMERIC_CHARACTERS = '.,'",
|
||||
|
|
|
@ -1468,4 +1468,30 @@ SQL
|
|||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function fetchTableOptionsByTable(bool $includeTableName): string
|
||||
{
|
||||
$sql = <<<'SQL'
|
||||
SELECT t.TABLE_NAME,
|
||||
t.ENGINE,
|
||||
t.AUTO_INCREMENT,
|
||||
t.TABLE_COMMENT,
|
||||
t.CREATE_OPTIONS,
|
||||
t.TABLE_COLLATION,
|
||||
ccsa.CHARACTER_SET_NAME
|
||||
FROM information_schema.TABLES t
|
||||
INNER JOIN information_schema.COLLATION_CHARACTER_SET_APPLICABILITY ccsa
|
||||
ON ccsa.COLLATION_NAME = t.TABLE_COLLATION
|
||||
SQL;
|
||||
|
||||
$conditions = ['t.TABLE_SCHEMA = ?'];
|
||||
|
||||
if ($includeTableName) {
|
||||
$conditions[] = 't.TABLE_NAME = ?';
|
||||
}
|
||||
|
||||
$conditions[] = "t.TABLE_TYPE = 'BASE TABLE'";
|
||||
|
||||
return $sql . ' WHERE ' . implode(' AND ', $conditions);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4693,6 +4693,11 @@ abstract class AbstractPlatform
|
|||
return false;
|
||||
}
|
||||
|
||||
// If disableTypeComments is true, we do not need to check types, all comparison is already done above
|
||||
if ($this->disableTypeComments) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $column1->getType() === $column2->getType();
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Platforms\Keywords;
|
||||
|
||||
use Doctrine\Deprecations\Deprecation;
|
||||
|
||||
use function array_diff;
|
||||
use function array_merge;
|
||||
|
||||
/**
|
||||
* MySQL 8.4 reserved keywords list.
|
||||
*/
|
||||
class MySQL84Keywords extends MySQL80Keywords
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
Deprecation::triggerIfCalledFromOutside(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/5433',
|
||||
'MySQL84Keywords::getName() is deprecated.',
|
||||
);
|
||||
|
||||
return 'MySQL84';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @link https://dev.mysql.com/doc/refman/8.4/en/keywords.html
|
||||
*/
|
||||
protected function getKeywords()
|
||||
{
|
||||
$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',
|
||||
'GTIDS',
|
||||
'LOG',
|
||||
'MANUAL',
|
||||
'PARALLEL',
|
||||
'PARSE_TREE',
|
||||
'QUALIFY',
|
||||
'S3',
|
||||
'TABLESAMPLE',
|
||||
]);
|
||||
|
||||
return $keywords;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\Platforms;
|
||||
|
||||
use Doctrine\DBAL\SQL\Builder\SelectSQLBuilder;
|
||||
|
||||
use function implode;
|
||||
|
||||
/**
|
||||
* Provides the behavior, features and SQL dialect of the MariaDB 10.10 database platform.
|
||||
*/
|
||||
class MariaDb1010Platform extends MariaDb1060Platform
|
||||
{
|
||||
public function createSelectSQLBuilder(): SelectSQLBuilder
|
||||
{
|
||||
return AbstractPlatform::createSelectSQLBuilder();
|
||||
}
|
||||
|
||||
public function fetchTableOptionsByTable(bool $includeTableName): string
|
||||
{
|
||||
// MariaDB-10.10.1 added FULL_COLLATION_NAME to the information_schema.COLLATION_CHARACTER_SET_APPLICABILITY.
|
||||
// A base collation like uca1400_ai_ci can refer to multiple character sets. The value in the
|
||||
// information_schema.TABLES.TABLE_COLLATION corresponds to the full collation name.
|
||||
$sql = <<<'SQL'
|
||||
SELECT t.TABLE_NAME,
|
||||
t.ENGINE,
|
||||
t.AUTO_INCREMENT,
|
||||
t.TABLE_COMMENT,
|
||||
t.CREATE_OPTIONS,
|
||||
t.TABLE_COLLATION,
|
||||
ccsa.CHARACTER_SET_NAME
|
||||
FROM information_schema.TABLES t
|
||||
INNER JOIN information_schema.COLLATION_CHARACTER_SET_APPLICABILITY ccsa
|
||||
ON ccsa.FULL_COLLATION_NAME = t.TABLE_COLLATION
|
||||
SQL;
|
||||
|
||||
$conditions = ['t.TABLE_SCHEMA = ?'];
|
||||
|
||||
if ($includeTableName) {
|
||||
$conditions[] = 't.TABLE_NAME = ?';
|
||||
}
|
||||
|
||||
$conditions[] = "t.TABLE_TYPE = 'BASE TABLE'";
|
||||
|
||||
return $sql . ' WHERE ' . implode(' AND ', $conditions);
|
||||
}
|
||||
}
|
|
@ -3,9 +3,7 @@
|
|||
namespace Doctrine\DBAL\Platforms;
|
||||
|
||||
/**
|
||||
* Provides the behavior, features and SQL dialect of the MariaDB 10.2 (10.2.7 GA) database platform.
|
||||
*
|
||||
* Note: Should not be used with versions prior to 10.2.7.
|
||||
* Provides the behavior, features and SQL dialect of the MariaDB 10.2 database platform.
|
||||
*
|
||||
* @deprecated This class will be merged with {@see MariaDBPlatform} in 4.0 because support for MariaDB
|
||||
* releases prior to 10.4.3 will be dropped.
|
||||
|
|
|
@ -8,7 +8,7 @@ use Doctrine\Deprecations\Deprecation;
|
|||
use function sprintf;
|
||||
|
||||
/**
|
||||
* Provides the behavior, features and SQL dialect of the MariaDB 10.4 (10.4.6 GA) database platform.
|
||||
* Provides the behavior, features and SQL dialect of the MariaDB 10.4 database platform.
|
||||
*
|
||||
* Extend deprecated MariaDb1027Platform to ensure correct functions used in MySQLSchemaManager which
|
||||
* tests for MariaDb1027Platform not MariaDBPlatform.
|
||||
|
|
|
@ -6,9 +6,7 @@ use Doctrine\DBAL\Schema\Index;
|
|||
use Doctrine\DBAL\Schema\TableDiff;
|
||||
|
||||
/**
|
||||
* Provides the behavior, features and SQL dialect of the MariaDB 10.5 (10.5.2 GA) database platform.
|
||||
*
|
||||
* Note: Should not be used with versions prior to 10.5.2.
|
||||
* Provides the behavior, features and SQL dialect of the MariaDB 10.5 database platform.
|
||||
*/
|
||||
class MariaDb1052Platform extends MariaDb1043Platform
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@ namespace Doctrine\DBAL\Platforms;
|
|||
use Doctrine\DBAL\SQL\Builder\SelectSQLBuilder;
|
||||
|
||||
/**
|
||||
* Provides the behavior, features and SQL dialect of the MariaDB 10.6 (10.6.0 GA) database platform.
|
||||
* Provides the behavior, features and SQL dialect of the MariaDB 10.6 database platform.
|
||||
*/
|
||||
class MariaDb1060Platform extends MariaDb1052Platform
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@ use Doctrine\DBAL\Types\Types;
|
|||
use Doctrine\Deprecations\Deprecation;
|
||||
|
||||
/**
|
||||
* Provides the behavior, features and SQL dialect of the MySQL 5.7 (5.7.9 GA) database platform.
|
||||
* Provides the behavior, features and SQL dialect of the MySQL 5.7 database platform.
|
||||
*
|
||||
* @deprecated This class will be merged with {@see MySQLPlatform} in 4.0 because support for MySQL
|
||||
* releases prior to 5.7 will be dropped.
|
||||
|
|
|
@ -6,7 +6,7 @@ use Doctrine\DBAL\SQL\Builder\SelectSQLBuilder;
|
|||
use Doctrine\Deprecations\Deprecation;
|
||||
|
||||
/**
|
||||
* Provides the behavior, features and SQL dialect of the MySQL 8.0 (8.0 GA) database platform.
|
||||
* Provides the behavior, features and SQL dialect of the MySQL 8.0 database platform.
|
||||
*/
|
||||
class MySQL80Platform extends MySQL57Platform
|
||||
{
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\Platforms;
|
||||
|
||||
use Doctrine\Deprecations\Deprecation;
|
||||
|
||||
/**
|
||||
* Provides the behavior, features and SQL dialect of the MySQL 8.4 database platform.
|
||||
*/
|
||||
class MySQL84Platform extends MySQL80Platform
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @deprecated Implement {@see createReservedKeywordsList()} instead.
|
||||
*/
|
||||
protected function getReservedKeywordsClass()
|
||||
{
|
||||
Deprecation::triggerIfCalledFromOutside(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/issues/4510',
|
||||
'MySQL84Platform::getReservedKeywordsClass() is deprecated,'
|
||||
. ' use MySQL84Platform::createReservedKeywordsList() instead.',
|
||||
);
|
||||
|
||||
return Keywords\MySQL84Keywords::class;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Platforms;
|
||||
|
||||
/**
|
||||
* Provides the behavior, features and SQL dialect of the PostgreSQL 12.0 database platform.
|
||||
*/
|
||||
class PostgreSQL120Platform extends PostgreSQL100Platform
|
||||
{
|
||||
public function getDefaultColumnValueSQLSnippet(): string
|
||||
{
|
||||
// in case of GENERATED ALWAYS AS (foobar) STORED column (added in PostgreSQL 12.0)
|
||||
// PostgreSQL's pg_get_expr(adbin, adrelid) will return the 'foobar' part
|
||||
// which is not the 'default' value of the column but its 'definition'
|
||||
// so in that case we force it to NULL as DBAL will use that column only for the
|
||||
// 'default' value
|
||||
return <<<'SQL'
|
||||
SELECT
|
||||
CASE
|
||||
WHEN a.attgenerated = 's' THEN NULL
|
||||
ELSE pg_get_expr(adbin, adrelid)
|
||||
END
|
||||
FROM pg_attrdef
|
||||
WHERE c.oid = pg_attrdef.adrelid
|
||||
AND pg_attrdef.adnum=a.attnum
|
||||
SQL;
|
||||
}
|
||||
}
|
|
@ -1193,6 +1193,19 @@ SQL
|
|||
return $sql;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the snippet used to retrieve the default value for a given column
|
||||
*/
|
||||
public function getDefaultColumnValueSQLSnippet(): string
|
||||
{
|
||||
return <<<'SQL'
|
||||
SELECT pg_get_expr(adbin, adrelid)
|
||||
FROM pg_attrdef
|
||||
WHERE c.oid = pg_attrdef.adrelid
|
||||
AND pg_attrdef.adnum=a.attnum
|
||||
SQL;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
|
|
@ -38,9 +38,12 @@ use function is_string;
|
|||
use function preg_match;
|
||||
use function preg_match_all;
|
||||
use function sprintf;
|
||||
use function str_ends_with;
|
||||
use function str_replace;
|
||||
use function str_starts_with;
|
||||
use function strpos;
|
||||
use function strtoupper;
|
||||
use function substr;
|
||||
use function substr_count;
|
||||
|
||||
use const PREG_OFFSET_CAPTURE;
|
||||
|
@ -399,6 +402,13 @@ class SQLServerPlatform extends AbstractPlatform
|
|||
return $sql . ' (' . $this->getIndexFieldDeclarationListSQL($index) . ')';
|
||||
}
|
||||
|
||||
private function unquoteSingleIdentifier(string $possiblyQuotedName): string
|
||||
{
|
||||
return str_starts_with($possiblyQuotedName, '[') && str_ends_with($possiblyQuotedName, ']')
|
||||
? substr($possiblyQuotedName, 1, -1)
|
||||
: $possiblyQuotedName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the SQL statement for creating a column comment.
|
||||
*
|
||||
|
@ -419,23 +429,20 @@ class SQLServerPlatform extends AbstractPlatform
|
|||
protected function getCreateColumnCommentSQL($tableName, $columnName, $comment)
|
||||
{
|
||||
if (strpos($tableName, '.') !== false) {
|
||||
[$schemaSQL, $tableSQL] = explode('.', $tableName);
|
||||
$schemaSQL = $this->quoteStringLiteral($schemaSQL);
|
||||
$tableSQL = $this->quoteStringLiteral($tableSQL);
|
||||
[$schemaName, $tableName] = explode('.', $tableName);
|
||||
} else {
|
||||
$schemaSQL = "'dbo'";
|
||||
$tableSQL = $this->quoteStringLiteral($tableName);
|
||||
$schemaName = 'dbo';
|
||||
}
|
||||
|
||||
return $this->getAddExtendedPropertySQL(
|
||||
'MS_Description',
|
||||
$comment,
|
||||
'SCHEMA',
|
||||
$schemaSQL,
|
||||
$this->quoteStringLiteral($this->unquoteSingleIdentifier($schemaName)),
|
||||
'TABLE',
|
||||
$tableSQL,
|
||||
$this->quoteStringLiteral($this->unquoteSingleIdentifier($tableName)),
|
||||
'COLUMN',
|
||||
$columnName,
|
||||
$this->quoteStringLiteral($this->unquoteSingleIdentifier($columnName)),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -806,23 +813,20 @@ class SQLServerPlatform extends AbstractPlatform
|
|||
protected function getAlterColumnCommentSQL($tableName, $columnName, $comment)
|
||||
{
|
||||
if (strpos($tableName, '.') !== false) {
|
||||
[$schemaSQL, $tableSQL] = explode('.', $tableName);
|
||||
$schemaSQL = $this->quoteStringLiteral($schemaSQL);
|
||||
$tableSQL = $this->quoteStringLiteral($tableSQL);
|
||||
[$schemaName, $tableName] = explode('.', $tableName);
|
||||
} else {
|
||||
$schemaSQL = "'dbo'";
|
||||
$tableSQL = $this->quoteStringLiteral($tableName);
|
||||
$schemaName = 'dbo';
|
||||
}
|
||||
|
||||
return $this->getUpdateExtendedPropertySQL(
|
||||
'MS_Description',
|
||||
$comment,
|
||||
'SCHEMA',
|
||||
$schemaSQL,
|
||||
$this->quoteStringLiteral($this->unquoteSingleIdentifier($schemaName)),
|
||||
'TABLE',
|
||||
$tableSQL,
|
||||
$this->quoteStringLiteral($this->unquoteSingleIdentifier($tableName)),
|
||||
'COLUMN',
|
||||
$columnName,
|
||||
$this->quoteStringLiteral($this->unquoteSingleIdentifier($columnName)),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -845,22 +849,19 @@ class SQLServerPlatform extends AbstractPlatform
|
|||
protected function getDropColumnCommentSQL($tableName, $columnName)
|
||||
{
|
||||
if (strpos($tableName, '.') !== false) {
|
||||
[$schemaSQL, $tableSQL] = explode('.', $tableName);
|
||||
$schemaSQL = $this->quoteStringLiteral($schemaSQL);
|
||||
$tableSQL = $this->quoteStringLiteral($tableSQL);
|
||||
[$schemaName, $tableName] = explode('.', $tableName);
|
||||
} else {
|
||||
$schemaSQL = "'dbo'";
|
||||
$tableSQL = $this->quoteStringLiteral($tableName);
|
||||
$schemaName = 'dbo';
|
||||
}
|
||||
|
||||
return $this->getDropExtendedPropertySQL(
|
||||
'MS_Description',
|
||||
'SCHEMA',
|
||||
$schemaSQL,
|
||||
$this->quoteStringLiteral($this->unquoteSingleIdentifier($schemaName)),
|
||||
'TABLE',
|
||||
$tableSQL,
|
||||
$this->quoteStringLiteral($this->unquoteSingleIdentifier($tableName)),
|
||||
'COLUMN',
|
||||
$columnName,
|
||||
$this->quoteStringLiteral($this->unquoteSingleIdentifier($columnName)),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -907,10 +908,13 @@ class SQLServerPlatform extends AbstractPlatform
|
|||
$level2Name = null
|
||||
) {
|
||||
return 'EXEC sp_addextendedproperty ' .
|
||||
'N' . $this->quoteStringLiteral($name) . ', N' . $this->quoteStringLiteral((string) $value) . ', ' .
|
||||
'N' . $this->quoteStringLiteral((string) $level0Type) . ', ' . $level0Name . ', ' .
|
||||
'N' . $this->quoteStringLiteral((string) $level1Type) . ', ' . $level1Name . ', ' .
|
||||
'N' . $this->quoteStringLiteral((string) $level2Type) . ', ' . $level2Name;
|
||||
'N' . $this->quoteStringLiteral($name) . ', N' . $this->quoteStringLiteral($value ?? '') . ', ' .
|
||||
'N' . $this->quoteStringLiteral($level0Type ?? '') . ', ' . $level0Name . ', ' .
|
||||
'N' . $this->quoteStringLiteral($level1Type ?? '') . ', ' . $level1Name .
|
||||
($level2Type !== null || $level2Name !== null
|
||||
? ', N' . $this->quoteStringLiteral($level2Type ?? '') . ', ' . $level2Name
|
||||
: ''
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -941,9 +945,12 @@ class SQLServerPlatform extends AbstractPlatform
|
|||
) {
|
||||
return 'EXEC sp_dropextendedproperty ' .
|
||||
'N' . $this->quoteStringLiteral($name) . ', ' .
|
||||
'N' . $this->quoteStringLiteral((string) $level0Type) . ', ' . $level0Name . ', ' .
|
||||
'N' . $this->quoteStringLiteral((string) $level1Type) . ', ' . $level1Name . ', ' .
|
||||
'N' . $this->quoteStringLiteral((string) $level2Type) . ', ' . $level2Name;
|
||||
'N' . $this->quoteStringLiteral($level0Type ?? '') . ', ' . $level0Name . ', ' .
|
||||
'N' . $this->quoteStringLiteral($level1Type ?? '') . ', ' . $level1Name .
|
||||
($level2Type !== null || $level2Name !== null
|
||||
? ', N' . $this->quoteStringLiteral($level2Type ?? '') . ', ' . $level2Name
|
||||
: ''
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -975,10 +982,13 @@ class SQLServerPlatform extends AbstractPlatform
|
|||
$level2Name = null
|
||||
) {
|
||||
return 'EXEC sp_updateextendedproperty ' .
|
||||
'N' . $this->quoteStringLiteral($name) . ', N' . $this->quoteStringLiteral((string) $value) . ', ' .
|
||||
'N' . $this->quoteStringLiteral((string) $level0Type) . ', ' . $level0Name . ', ' .
|
||||
'N' . $this->quoteStringLiteral((string) $level1Type) . ', ' . $level1Name . ', ' .
|
||||
'N' . $this->quoteStringLiteral((string) $level2Type) . ', ' . $level2Name;
|
||||
'N' . $this->quoteStringLiteral($name) . ', N' . $this->quoteStringLiteral($value ?? '') . ', ' .
|
||||
'N' . $this->quoteStringLiteral($level0Type ?? '') . ', ' . $level0Name . ', ' .
|
||||
'N' . $this->quoteStringLiteral($level1Type ?? '') . ', ' . $level1Name .
|
||||
($level2Type !== null || $level2Name !== null
|
||||
? ', N' . $this->quoteStringLiteral($level2Type ?? '') . ', ' . $level2Name
|
||||
: ''
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1296,7 +1306,7 @@ class SQLServerPlatform extends AbstractPlatform
|
|||
{
|
||||
$length = $column['length'] ?? null;
|
||||
|
||||
if (! isset($column['fixed'])) {
|
||||
if (empty($column['fixed'])) {
|
||||
return sprintf('VARCHAR(%d)', $length ?? 255);
|
||||
}
|
||||
|
||||
|
@ -1549,12 +1559,14 @@ class SQLServerPlatform extends AbstractPlatform
|
|||
'smalldatetime' => Types::DATETIME_MUTABLE,
|
||||
'smallint' => Types::SMALLINT,
|
||||
'smallmoney' => Types::INTEGER,
|
||||
'sysname' => Types::STRING,
|
||||
'text' => Types::TEXT,
|
||||
'time' => Types::TIME_MUTABLE,
|
||||
'tinyint' => Types::SMALLINT,
|
||||
'uniqueidentifier' => Types::GUID,
|
||||
'varbinary' => Types::BINARY,
|
||||
'varchar' => Types::STRING,
|
||||
'xml' => Types::TEXT,
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -1765,15 +1777,13 @@ class SQLServerPlatform extends AbstractPlatform
|
|||
|
||||
protected function getCommentOnTableSQL(string $tableName, ?string $comment): string
|
||||
{
|
||||
return sprintf(
|
||||
<<<'SQL'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description',
|
||||
@value=N%s, @level0type=N'SCHEMA', @level0name=N'dbo',
|
||||
@level1type=N'TABLE', @level1name=N%s
|
||||
SQL
|
||||
,
|
||||
$this->quoteStringLiteral((string) $comment),
|
||||
$this->quoteStringLiteral($tableName),
|
||||
return $this->getAddExtendedPropertySQL(
|
||||
'MS_Description',
|
||||
$comment,
|
||||
'SCHEMA',
|
||||
$this->quoteStringLiteral('dbo'),
|
||||
'TABLE',
|
||||
$this->quoteStringLiteral($this->unquoteSingleIdentifier($tableName)),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -950,11 +950,6 @@ class SqlitePlatform extends AbstractPlatform
|
|||
$name = $index->getQuotedName($this);
|
||||
$columns = $index->getColumns();
|
||||
|
||||
if (strpos($table, '.') !== false) {
|
||||
[$schema, $table] = explode('.', $table);
|
||||
$name = $schema . '.' . $name;
|
||||
}
|
||||
|
||||
if (count($columns) === 0) {
|
||||
throw new InvalidArgumentException(sprintf(
|
||||
'Incomplete or invalid index definition %s on table %s',
|
||||
|
@ -967,6 +962,11 @@ class SqlitePlatform extends AbstractPlatform
|
|||
return $this->getCreatePrimaryKeySQL($index, $table);
|
||||
}
|
||||
|
||||
if (strpos($table, '.') !== false) {
|
||||
[$schema, $table] = explode('.', $table, 2);
|
||||
$name = $schema . '.' . $name;
|
||||
}
|
||||
|
||||
$query = 'CREATE ' . $this->getCreateIndexSQLFlags($index) . 'INDEX ' . $name . ' ON ' . $table;
|
||||
$query .= ' (' . $this->getIndexFieldDeclarationListSQL($index) . ')' . $this->getPartialIndexSQL($index);
|
||||
|
||||
|
@ -1150,7 +1150,12 @@ class SqlitePlatform extends AbstractPlatform
|
|||
$sql = [];
|
||||
$tableSql = [];
|
||||
if (! $this->onSchemaAlterTable($diff, $tableSql)) {
|
||||
$dataTable = new Table('__temp__' . $table->getName());
|
||||
$tableName = $table->getName();
|
||||
if (strpos($tableName, '.') !== false) {
|
||||
[, $tableName] = explode('.', $tableName, 2);
|
||||
}
|
||||
|
||||
$dataTable = new Table('__temp__' . $tableName);
|
||||
|
||||
$newTable = new Table(
|
||||
$table->getQuotedName($this),
|
||||
|
|
|
@ -1734,7 +1734,7 @@ class QueryBuilder
|
|||
|
||||
/**
|
||||
* Enables caching of the results of this query, for given amount of seconds
|
||||
* and optionally specified witch key to use for the cache entry.
|
||||
* and optionally specified which key to use for the cache entry.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
|
|
|
@ -184,7 +184,7 @@ class Result
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @return Traversable<mixed, mixed>
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
|
|
|
@ -20,7 +20,8 @@ use function substr;
|
|||
* The abstract asset allows to reset the name of all assets without publishing this to the public userland.
|
||||
*
|
||||
* This encapsulation hack is necessary to keep a consistent state of the database schema. Say we have a list of tables
|
||||
* array($tableName => Table($tableName)); if you want to rename the table, you have to make sure
|
||||
* array($tableName => Table($tableName)); if you want to rename the table, you have to make sure this does not get
|
||||
* recreated during schema migration.
|
||||
*/
|
||||
abstract class AbstractAsset
|
||||
{
|
||||
|
|
|
@ -31,7 +31,7 @@ use function strtolower;
|
|||
* Base class for schema managers. Schema managers are used to inspect and/or
|
||||
* modify the database schema/structure.
|
||||
*
|
||||
* @template T of AbstractPlatform
|
||||
* @template-covariant T of AbstractPlatform
|
||||
*/
|
||||
abstract class AbstractSchemaManager
|
||||
{
|
||||
|
@ -1740,6 +1740,10 @@ abstract class AbstractSchemaManager
|
|||
*/
|
||||
public function extractDoctrineTypeFromComment($comment, $currentType)
|
||||
{
|
||||
if ($this->_conn->getConfiguration()->getDisableTypeComments()) {
|
||||
return $currentType;
|
||||
}
|
||||
|
||||
if ($comment !== null && preg_match('(\(DC2Type:(((?!\)).)+)\))', $comment, $match) === 1) {
|
||||
return $match[1];
|
||||
}
|
||||
|
@ -1757,6 +1761,10 @@ abstract class AbstractSchemaManager
|
|||
*/
|
||||
public function removeDoctrineTypeFromComment($comment, $type)
|
||||
{
|
||||
if ($this->_conn->getConfiguration()->getDisableTypeComments()) {
|
||||
return $comment;
|
||||
}
|
||||
|
||||
if ($comment === null) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -557,31 +557,13 @@ SQL;
|
|||
*/
|
||||
protected function fetchTableOptionsByTable(string $databaseName, ?string $tableName = null): array
|
||||
{
|
||||
$sql = <<<'SQL'
|
||||
SELECT t.TABLE_NAME,
|
||||
t.ENGINE,
|
||||
t.AUTO_INCREMENT,
|
||||
t.TABLE_COMMENT,
|
||||
t.CREATE_OPTIONS,
|
||||
t.TABLE_COLLATION,
|
||||
ccsa.CHARACTER_SET_NAME
|
||||
FROM information_schema.TABLES t
|
||||
INNER JOIN information_schema.COLLATION_CHARACTER_SET_APPLICABILITY ccsa
|
||||
ON ccsa.COLLATION_NAME = t.TABLE_COLLATION
|
||||
SQL;
|
||||
|
||||
$conditions = ['t.TABLE_SCHEMA = ?'];
|
||||
$params = [$databaseName];
|
||||
$sql = $this->_platform->fetchTableOptionsByTable($tableName !== null);
|
||||
|
||||
$params = [$databaseName];
|
||||
if ($tableName !== null) {
|
||||
$conditions[] = 't.TABLE_NAME = ?';
|
||||
$params[] = $tableName;
|
||||
$params[] = $tableName;
|
||||
}
|
||||
|
||||
$conditions[] = "t.TABLE_TYPE = 'BASE TABLE'";
|
||||
|
||||
$sql .= ' WHERE ' . implode(' AND ', $conditions);
|
||||
|
||||
/** @var array<string,array<string,mixed>> $metadata */
|
||||
$metadata = $this->_conn->executeQuery($sql, $params)
|
||||
->fetchAllAssociativeIndexed();
|
||||
|
|
|
@ -463,6 +463,7 @@ SQL,
|
|||
$length = null;
|
||||
break;
|
||||
|
||||
case 'json':
|
||||
case 'text':
|
||||
case '_varchar':
|
||||
case 'varchar':
|
||||
|
@ -616,7 +617,7 @@ SQL;
|
|||
$sql .= ' c.relname AS table_name, n.nspname AS schema_name,';
|
||||
}
|
||||
|
||||
$sql .= <<<'SQL'
|
||||
$sql .= sprintf(<<<'SQL'
|
||||
a.attnum,
|
||||
quote_ident(a.attname) AS field,
|
||||
t.typname AS type,
|
||||
|
@ -632,11 +633,7 @@ SQL;
|
|||
AND pg_index.indkey[0] = a.attnum
|
||||
AND pg_index.indisprimary = 't'
|
||||
) AS pri,
|
||||
(SELECT pg_get_expr(adbin, adrelid)
|
||||
FROM pg_attrdef
|
||||
WHERE c.oid = pg_attrdef.adrelid
|
||||
AND pg_attrdef.adnum=a.attnum
|
||||
) AS default,
|
||||
(%s) AS default,
|
||||
(SELECT pg_description.description
|
||||
FROM pg_description WHERE pg_description.objoid = c.oid AND a.attnum = pg_description.objsubid
|
||||
) AS comment
|
||||
|
@ -651,7 +648,7 @@ SQL;
|
|||
ON d.objid = c.oid
|
||||
AND d.deptype = 'e'
|
||||
AND d.classid = (SELECT oid FROM pg_class WHERE relname = 'pg_class')
|
||||
SQL;
|
||||
SQL, $this->_platform->getDefaultColumnValueSQLSnippet());
|
||||
|
||||
$conditions = array_merge([
|
||||
'a.attnum > 0',
|
||||
|
|
|
@ -202,7 +202,7 @@ class SqliteSchemaManager extends AbstractSchemaManager
|
|||
{
|
||||
$table = $this->normalizeName($table);
|
||||
|
||||
$columns = $this->selectForeignKeyColumns('', $table)
|
||||
$columns = $this->selectForeignKeyColumns($database ?? 'main', $table)
|
||||
->fetchAllAssociative();
|
||||
|
||||
if (count($columns) > 0) {
|
||||
|
@ -744,7 +744,7 @@ SQL;
|
|||
p.*
|
||||
FROM sqlite_master t
|
||||
JOIN pragma_foreign_key_list(t.name) p
|
||||
ON p."seq" != "-1"
|
||||
ON p."seq" != '-1'
|
||||
SQL;
|
||||
|
||||
$conditions = [
|
||||
|
|
|
@ -9,6 +9,7 @@ use Doctrine\DBAL\Platforms\Keywords\KeywordList;
|
|||
use Doctrine\DBAL\Platforms\Keywords\MariaDb102Keywords;
|
||||
use Doctrine\DBAL\Platforms\Keywords\MySQL57Keywords;
|
||||
use Doctrine\DBAL\Platforms\Keywords\MySQL80Keywords;
|
||||
use Doctrine\DBAL\Platforms\Keywords\MySQL84Keywords;
|
||||
use Doctrine\DBAL\Platforms\Keywords\MySQLKeywords;
|
||||
use Doctrine\DBAL\Platforms\Keywords\OracleKeywords;
|
||||
use Doctrine\DBAL\Platforms\Keywords\PostgreSQL100Keywords;
|
||||
|
@ -59,6 +60,7 @@ class ReservedWordsCommand extends Command
|
|||
'mysql' => new MySQLKeywords(),
|
||||
'mysql57' => new MySQL57Keywords(),
|
||||
'mysql80' => new MySQL80Keywords(),
|
||||
'mysql84' => new MySQL84Keywords(),
|
||||
'oracle' => new OracleKeywords(),
|
||||
'pgsql' => new PostgreSQL94Keywords(),
|
||||
'pgsql100' => new PostgreSQL100Keywords(),
|
||||
|
@ -130,6 +132,7 @@ The following keyword lists are currently shipped with Doctrine:
|
|||
* mysql
|
||||
* mysql57
|
||||
* mysql80
|
||||
* mysql84
|
||||
* oracle
|
||||
* pgsql
|
||||
* pgsql100
|
||||
|
|
|
@ -11,18 +11,19 @@ use Doctrine\Deprecations\Deprecation;
|
|||
use function get_class;
|
||||
|
||||
/**
|
||||
* DateTime type saving additional timezone information.
|
||||
* DateTime type accepting additional information about timezone offsets.
|
||||
*
|
||||
* Caution: Databases are not necessarily experts at storing timezone related
|
||||
* data of dates. First, of all the supported vendors only PostgreSQL and Oracle
|
||||
* support storing Timezone data. But those two don't save the actual timezone
|
||||
* attached to a DateTime instance (for example "Europe/Berlin" or "America/Montreal")
|
||||
* but the current offset of them related to UTC. That means depending on daylight saving times
|
||||
* or not you may get different offsets.
|
||||
* data of dates. First, of not all the supported vendors support storing Timezone data, and some of
|
||||
* them only use the offset to calculate the timestamp in its default timezone (usually UTC) and persist
|
||||
* the value without the offset information. They even don't save the actual timezone names attached
|
||||
* to a DateTime instance (for example "Europe/Berlin" or "America/Montreal") but the current offset
|
||||
* of them related to UTC. That means, depending on daylight saving times or not, you may get different
|
||||
* offsets.
|
||||
*
|
||||
* This datatype makes only sense to use, if your application works with an offset, not
|
||||
* with an actual timezone that uses transitions. Otherwise your DateTime instance
|
||||
* attached with a timezone such as Europe/Berlin gets saved into the database with
|
||||
* This datatype makes only sense to use, if your application only needs to accept the timezone offset,
|
||||
* not the actual timezone that uses transitions. Otherwise your DateTime instance
|
||||
* attached with a timezone such as "Europe/Berlin" gets saved into the database with
|
||||
* the offset and re-created from persistence with only the offset, not the original timezone
|
||||
* attached.
|
||||
*/
|
||||
|
|
Загрузка…
Ссылка в новой задаче