Skip to content

Commit

Permalink
Merge branch '4.0.x' into 4.1.x
Browse files Browse the repository at this point in the history
* 4.0.x:
  [Documentation] Adding exact command for Postgres serial migration (#6305)
  [3.8.x] AbstractPlatform - allow any string in interval for date interval expression (#6302)
  Update UPGRADE.md
  Psalm 5.21.1 (#6294)
  • Loading branch information
derrabus committed Feb 13, 2024
2 parents 2f33140 + f41c74a commit 77a4d4f
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ awareness about deprecated code.
The methods `AbstractPlatform::getReadLockSQL()`, `::getWriteLockSQL()` and `::getForUpdateSQL()` have been removed
Use `QueryBuilder::forUpdate()` as a replacement for the latter.

## BC BREAK: BIGINT vales are cast to int if possible
## BC BREAK: BIGINT values are cast to int if possible

`BigIntType` casts values retrieved from the database to int if they're inside
the integer range of PHP. Previously, those values were always cast to string.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"squizlabs/php_codesniffer": "3.8.1",
"symfony/cache": "^6.3.8|^7.0",
"symfony/console": "^5.4|^6.3|^7.0",
"vimeo/psalm": "5.16.0"
"vimeo/psalm": "5.21.1"
},
"suggest": {
"symfony/console": "For helpful console commands such as SQL execution and import of files."
Expand Down
6 changes: 5 additions & 1 deletion docs/en/how-to/postgresql-identity-migration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ the schema with the DBAL:
END;
$$;
3. For each column and their table, run ``upgrade_serial_to_identity(<table>, <column>)``.
3. Run the function for each table like this:

.. code-block:: sql
SELECT upgrade_serial_to_identity('article', 'id');
Without this migration, next time when DBAL 4 is used to manage the schema, it will perform a similar migration
but instead of reusing the existing sequence, it will drop it and create a new one. As a result,
Expand Down
4 changes: 3 additions & 1 deletion src/Driver/OCI8/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ public function connect(

$connectionString = $this->getEasyConnectString($params);

/** @psalm-suppress RiskyTruthyFalsyComparison */
$persistent = ! empty($params['persistent']);
$exclusive = ! empty($params['driverOptions']['exclusive']);
/** @psalm-suppress RiskyTruthyFalsyComparison */
$exclusive = ! empty($params['driverOptions']['exclusive']);

if ($persistent && $exclusive) {
throw InvalidConfiguration::forPersistentAndExclusive();
Expand Down
1 change: 1 addition & 0 deletions src/Platforms/SQLitePlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,7 @@ private function getSimpleAlterTableSQL(TableDiff $diff): array|false

$type = $definition['type'];

/** @psalm-suppress RiskyTruthyFalsyComparison */
switch (true) {
case isset($definition['columnDefinition']) || $definition['autoincrement'] || $definition['unique']:
case $type instanceof Types\DateTimeType && $definition['default'] === $this->getCurrentTimestampSQL():
Expand Down
1 change: 1 addition & 0 deletions tests/Functional/Driver/OCI8/ResultTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public function testTruncatedFetch(
// after the initial prefetch that caches locally the first X results
$this->createOrReplacePipelinedFunction($expectedTotalRowCount + 10);

/** @var callable|null $previous */
$previous = null;
$previous = set_error_handler(static function (int $errno, string $errstr) use (&$previous): bool {
if (str_contains($errstr, 'ORA-04061')) {
Expand Down
1 change: 1 addition & 0 deletions tests/Functional/ExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public function testInvalidFieldNameException(): void
$this->expectException(Exception\InvalidFieldNameException::class);

// prevent the PHPUnit error handler from handling the warning that db2_bind_param() may trigger
/** @var callable|null $previous */
$previous = null;
$previous = set_error_handler(static function (int $errno) use (&$previous): bool {
if (($errno & ~E_WARNING) === 0) {
Expand Down
1 change: 1 addition & 0 deletions tests/Functional/TransactionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ private function expectConnectionLoss(callable $scenario): void
$this->expectException(ConnectionLost::class);

// prevent the PHPUnit error handler from handling the "MySQL server has gone away" warning
/** @var callable|null $previous */
$previous = null;
$previous = set_error_handler(static function (int $errno) use (&$previous): bool {
if (($errno & ~E_WARNING) === 0) {
Expand Down

0 comments on commit 77a4d4f

Please sign in to comment.