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 @@ -52,6 +52,7 @@
- Enh #327: Refactor constraints (@Tigrov)
- Chg #330: Rename `insertWithReturningPks()` to `insertReturningPks()` in `Command` and `DMLQueryBuilder` classes (@Tigrov)
- Enh #336: Provide `yiisoft/db-implementation` virtual package (@vjik)
- Enh #340: Adapt to `Param` refactoring in `yiisoft/db` package (@vjik)

## 1.3.0 March 21, 2024

Expand Down
7 changes: 3 additions & 4 deletions src/Column/BinaryColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Yiisoft\Db\Oracle\Column;

use Yiisoft\Db\Command\ParamInterface;
use Yiisoft\Db\Command\Param;
use Yiisoft\Db\Expression\Expression;
use Yiisoft\Db\Schema\Column\BinaryColumn as BaseBinaryColumn;

Expand All @@ -15,9 +15,8 @@ final class BinaryColumn extends BaseBinaryColumn
public function dbTypecast(mixed $value): mixed
{
if ($this->getDbType() === 'blob') {
if ($value instanceof ParamInterface && is_string($value->getValue())) {
/** @var string */
$value = $value->getValue();
if ($value instanceof Param && is_string($value->value)) {
$value = $value->value;
}

if (is_string($value)) {
Expand Down
16 changes: 6 additions & 10 deletions src/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,21 +114,17 @@ public function showDatabases(): array
protected function bindPendingParams(): void
{
$paramsPassedByReference = [];

$params = $this->params;

foreach ($params as $name => $value) {
if (PDO::PARAM_STR === $value->getType()) {
/** @var mixed */
$paramsPassedByReference[$name] = $value->getValue();
foreach ($this->params as $name => $param) {
if (PDO::PARAM_STR === $param->type) {
$paramsPassedByReference[$name] = $param->value;
$this->pdoStatement?->bindParam(
$name,
$paramsPassedByReference[$name],
$value->getType(),
strlen((string) $value->getValue())
$param->type,
strlen((string) $param->value)
);
} else {
$this->pdoStatement?->bindValue($name, $value->getValue(), $value->getType());
$this->pdoStatement?->bindValue($name, $param->value, $param->type);
}
}
}
Expand Down
Loading