| @@ 671-690 (lines=20) @@ | ||
| 668 | ||
| 669 | return false; |
|
| 670 | } |
|
| 671 | } else { |
|
| 672 | /** @var OCI_Lob[] $lob */ |
|
| 673 | $lob[$col] = oci_new_descriptor( $this->mConn, OCI_D_LOB ); |
|
| 674 | if ( $lob[$col] === false ) { |
|
| 675 | $e = oci_error( $stmt ); |
|
| 676 | throw new DBUnexpectedError( $this, "Cannot create LOB descriptor: " . $e['message'] ); |
|
| 677 | } |
|
| 678 | ||
| 679 | if ( is_object( $val ) ) { |
|
| 680 | $val = $val->fetch(); |
|
| 681 | } |
|
| 682 | ||
| 683 | if ( $col_type == 'BLOB' ) { |
|
| 684 | $lob[$col]->writeTemporary( $val, OCI_TEMP_BLOB ); |
|
| 685 | oci_bind_by_name( $stmt, ":$col", $lob[$col], -1, OCI_B_BLOB ); |
|
| 686 | } else { |
|
| 687 | $lob[$col]->writeTemporary( $val, OCI_TEMP_CLOB ); |
|
| 688 | oci_bind_by_name( $stmt, ":$col", $lob[$col], -1, OCI_B_CLOB ); |
|
| 689 | } |
|
| 690 | } |
|
| 691 | } |
|
| 692 | ||
| 693 | MediaWiki\suppressWarnings(); |
|
| @@ 1465-1484 (lines=20) @@ | ||
| 1462 | ||
| 1463 | return false; |
|
| 1464 | } |
|
| 1465 | } else { |
|
| 1466 | /** @var OCI_Lob[] $lob */ |
|
| 1467 | $lob[$col] = oci_new_descriptor( $this->mConn, OCI_D_LOB ); |
|
| 1468 | if ( $lob[$col] === false ) { |
|
| 1469 | $e = oci_error( $stmt ); |
|
| 1470 | throw new DBUnexpectedError( $this, "Cannot create LOB descriptor: " . $e['message'] ); |
|
| 1471 | } |
|
| 1472 | ||
| 1473 | if ( is_object( $val ) ) { |
|
| 1474 | $val = $val->getData(); |
|
| 1475 | } |
|
| 1476 | ||
| 1477 | if ( $col_type == 'BLOB' ) { |
|
| 1478 | $lob[$col]->writeTemporary( $val ); |
|
| 1479 | oci_bind_by_name( $stmt, ":$col", $lob[$col], -1, SQLT_BLOB ); |
|
| 1480 | } else { |
|
| 1481 | $lob[$col]->writeTemporary( $val ); |
|
| 1482 | oci_bind_by_name( $stmt, ":$col", $lob[$col], -1, OCI_B_CLOB ); |
|
| 1483 | } |
|
| 1484 | } |
|
| 1485 | } |
|
| 1486 | ||
| 1487 | MediaWiki\suppressWarnings(); |
|