| @@ 609-628 (lines=20) @@ | ||
| 606 | ||
| 607 | return false; |
|
| 608 | } |
|
| 609 | } else { |
|
| 610 | /** @var OCI_Lob[] $lob */ |
|
| 611 | $lob[$col] = oci_new_descriptor( $this->mConn, OCI_D_LOB ); |
|
| 612 | if ( $lob[$col] === false ) { |
|
| 613 | $e = oci_error( $stmt ); |
|
| 614 | throw new DBUnexpectedError( $this, "Cannot create LOB descriptor: " . $e['message'] ); |
|
| 615 | } |
|
| 616 | ||
| 617 | if ( is_object( $val ) ) { |
|
| 618 | $val = $val->fetch(); |
|
| 619 | } |
|
| 620 | ||
| 621 | if ( $col_type == 'BLOB' ) { |
|
| 622 | $lob[$col]->writeTemporary( $val, OCI_TEMP_BLOB ); |
|
| 623 | oci_bind_by_name( $stmt, ":$col", $lob[$col], -1, OCI_B_BLOB ); |
|
| 624 | } else { |
|
| 625 | $lob[$col]->writeTemporary( $val, OCI_TEMP_CLOB ); |
|
| 626 | oci_bind_by_name( $stmt, ":$col", $lob[$col], -1, OCI_B_CLOB ); |
|
| 627 | } |
|
| 628 | } |
|
| 629 | } |
|
| 630 | ||
| 631 | MediaWiki\suppressWarnings(); |
|
| @@ 1410-1429 (lines=20) @@ | ||
| 1407 | ||
| 1408 | return false; |
|
| 1409 | } |
|
| 1410 | } else { |
|
| 1411 | /** @var OCI_Lob[] $lob */ |
|
| 1412 | $lob[$col] = oci_new_descriptor( $this->mConn, OCI_D_LOB ); |
|
| 1413 | if ( $lob[$col] === false ) { |
|
| 1414 | $e = oci_error( $stmt ); |
|
| 1415 | throw new DBUnexpectedError( $this, "Cannot create LOB descriptor: " . $e['message'] ); |
|
| 1416 | } |
|
| 1417 | ||
| 1418 | if ( is_object( $val ) ) { |
|
| 1419 | $val = $val->getData(); |
|
| 1420 | } |
|
| 1421 | ||
| 1422 | if ( $col_type == 'BLOB' ) { |
|
| 1423 | $lob[$col]->writeTemporary( $val ); |
|
| 1424 | oci_bind_by_name( $stmt, ":$col", $lob[$col], -1, SQLT_BLOB ); |
|
| 1425 | } else { |
|
| 1426 | $lob[$col]->writeTemporary( $val ); |
|
| 1427 | oci_bind_by_name( $stmt, ":$col", $lob[$col], -1, OCI_B_CLOB ); |
|
| 1428 | } |
|
| 1429 | } |
|
| 1430 | } |
|
| 1431 | ||
| 1432 | MediaWiki\suppressWarnings(); |
|