|
12 | 12 | use Yiisoft\Db\Query\QueryInterface; |
13 | 13 | use Yiisoft\Db\QueryBuilder\QueryBuilderInterface; |
14 | 14 | use Yiisoft\Db\Schema\Builder\ColumnInterface; |
| 15 | +use Yiisoft\Db\Schema\SchemaInterface; |
15 | 16 |
|
16 | 17 | use function explode; |
17 | 18 | use function get_resource_type; |
| 19 | +use function gettype; |
18 | 20 | use function is_array; |
19 | 21 | use function is_int; |
20 | 22 | use function is_resource; |
@@ -351,11 +353,13 @@ public function getRawSql(): string |
351 | 353 | $value = $param->getValue(); |
352 | 354 |
|
353 | 355 | $params[$name] = match ($param->getType()) { |
354 | | - DataType::INTEGER => (string)(int)$value, |
355 | | - DataType::STRING, DataType::LOB => match (true) { |
356 | | - $value instanceof Expression => (string)$value, |
357 | | - is_resource($value) => $name, |
358 | | - default => $quoter->quoteValue((string)$value), |
| 356 | + DataType::INTEGER => (string) (int) $value, |
| 357 | + DataType::STRING, DataType::LOB => match (gettype($value)) { |
| 358 | + SchemaInterface::PHP_TYPE_RESOURCE => $name, |
| 359 | + SchemaInterface::PHP_TYPE_DOUBLE => (string) $value, |
| 360 | + default => $value instanceof Expression |
| 361 | + ? (string) $value |
| 362 | + : $quoter->quoteValue((string) $value), |
359 | 363 | }, |
360 | 364 | DataType::BOOLEAN => $value ? 'TRUE' : 'FALSE', |
361 | 365 | DataType::NULL => 'NULL', |
|
0 commit comments