Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
- Enh #423: Refactor `DMLQueryBuilder::upsert()` method (@Tigrov)
- Chg #428: Update expression namespaces according to changes in `yiisoft/db` package (@Tigrov)
- Enh #432, #433: Update `DMLQueryBuilder::update()` method to adapt changes in `yiisoft/db` (@rustamwin, @Tigrov)
- Enh #439: Move "Packets out of order" warning suppression from Yii DB (@vjik)

## 1.2.0 March 21, 2024

Expand Down
17 changes: 17 additions & 0 deletions src/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
use Yiisoft\Db\Query\QueryInterface;

use function in_array;
use function restore_error_handler;
use function set_error_handler;
use function str_starts_with;
use function substr;

Expand Down Expand Up @@ -146,4 +148,19 @@ public function showDatabases(): array

return $this->setSql($sql)->queryColumn();
}

protected function pdoStatementExecute(): void
{
set_error_handler(
static fn(int $errorNumber, string $errorString): bool =>
str_starts_with($errorString, 'Packets out of order. Expected '),
E_WARNING,
);

try {
$this->pdoStatement?->execute();
} finally {
restore_error_handler();
}
}
}
Loading