| @@ 683-702 (lines=20) @@ | ||
| 680 | ||
| 681 | return false; |
|
| 682 | } |
|
| 683 | } else { |
|
| 684 | /** @var OCI_Lob[] $lob */ |
|
| 685 | $lob[$col] = oci_new_descriptor( $this->mConn, OCI_D_LOB ); |
|
| 686 | if ( $lob[$col] === false ) { |
|
| 687 | $e = oci_error( $stmt ); |
|
| 688 | throw new DBUnexpectedError( $this, "Cannot create LOB descriptor: " . $e['message'] ); |
|
| 689 | } |
|
| 690 | ||
| 691 | if ( is_object( $val ) ) { |
|
| 692 | $val = $val->fetch(); |
|
| 693 | } |
|
| 694 | ||
| 695 | if ( $col_type == 'BLOB' ) { |
|
| 696 | $lob[$col]->writeTemporary( $val, OCI_TEMP_BLOB ); |
|
| 697 | oci_bind_by_name( $stmt, ":$col", $lob[$col], -1, OCI_B_BLOB ); |
|
| 698 | } else { |
|
| 699 | $lob[$col]->writeTemporary( $val, OCI_TEMP_CLOB ); |
|
| 700 | oci_bind_by_name( $stmt, ":$col", $lob[$col], -1, OCI_B_CLOB ); |
|
| 701 | } |
|
| 702 | } |
|
| 703 | } |
|
| 704 | ||
| 705 | MediaWiki\suppressWarnings(); |
|
| @@ 1477-1496 (lines=20) @@ | ||
| 1474 | ||
| 1475 | return false; |
|
| 1476 | } |
|
| 1477 | } else { |
|
| 1478 | /** @var OCI_Lob[] $lob */ |
|
| 1479 | $lob[$col] = oci_new_descriptor( $this->mConn, OCI_D_LOB ); |
|
| 1480 | if ( $lob[$col] === false ) { |
|
| 1481 | $e = oci_error( $stmt ); |
|
| 1482 | throw new DBUnexpectedError( $this, "Cannot create LOB descriptor: " . $e['message'] ); |
|
| 1483 | } |
|
| 1484 | ||
| 1485 | if ( is_object( $val ) ) { |
|
| 1486 | $val = $val->getData(); |
|
| 1487 | } |
|
| 1488 | ||
| 1489 | if ( $col_type == 'BLOB' ) { |
|
| 1490 | $lob[$col]->writeTemporary( $val ); |
|
| 1491 | oci_bind_by_name( $stmt, ":$col", $lob[$col], -1, SQLT_BLOB ); |
|
| 1492 | } else { |
|
| 1493 | $lob[$col]->writeTemporary( $val ); |
|
| 1494 | oci_bind_by_name( $stmt, ":$col", $lob[$col], -1, OCI_B_CLOB ); |
|
| 1495 | } |
|
| 1496 | } |
|
| 1497 | } |
|
| 1498 | ||
| 1499 | MediaWiki\suppressWarnings(); |
|