Index: trunk/phase3/includes/db/DatabaseOracle.php |
— | — | @@ -534,7 +534,7 @@ |
535 | 535 | // do nothing ... null was inserted in statement creation |
536 | 536 | } elseif ( $col_type != 'BLOB' && $col_type != 'CLOB' ) { |
537 | 537 | if ( is_object( $val ) ) { |
538 | | - $val = $val->getData(); |
| 538 | + $val = $val->fetch(); |
539 | 539 | } |
540 | 540 | |
541 | 541 | if ( preg_match( '/^timestamp.*/i', $col_type ) == 1 && strtolower( $val ) == 'infinity' ) { |
— | — | @@ -553,11 +553,15 @@ |
554 | 554 | throw new DBUnexpectedError( $this, "Cannot create LOB descriptor: " . $e['message'] ); |
555 | 555 | } |
556 | 556 | |
| 557 | + if ( is_object( $val ) ) { |
| 558 | + $val = $val->fetch(); |
| 559 | + } |
| 560 | + |
557 | 561 | if ( $col_type == 'BLOB' ) { |
558 | | - $lob[$col]->writeTemporary( $val ); |
559 | | - oci_bind_by_name( $stmt, ":$col", $lob[$col], - 1, SQLT_BLOB ); |
| 562 | + $lob[$col]->writeTemporary( $val, OCI_TEMP_BLOB ); |
| 563 | + oci_bind_by_name( $stmt, ":$col", $lob[$col], - 1, OCI_B_BLOB ); |
560 | 564 | } else { |
561 | | - $lob[$col]->writeTemporary( $val ); |
| 565 | + $lob[$col]->writeTemporary( $val, OCI_TEMP_CLOB ); |
562 | 566 | oci_bind_by_name( $stmt, ":$col", $lob[$col], - 1, OCI_B_CLOB ); |
563 | 567 | } |
564 | 568 | } |
— | — | @@ -812,6 +816,17 @@ |
813 | 817 | return "SELECT * FROM ($sql) WHERE rownum >= (1 + $offset) AND rownum < (1 + $limit + $offset)"; |
814 | 818 | } |
815 | 819 | |
| 820 | + function encodeBlob( $b ) { |
| 821 | + return new Blob( $b ); |
| 822 | + } |
| 823 | + |
| 824 | + function decodeBlob( $b ) { |
| 825 | + if ( $b instanceof Blob ) { |
| 826 | + $b = $b->fetch(); |
| 827 | + } |
| 828 | + return $b; |
| 829 | + } |
| 830 | + |
816 | 831 | function unionQueries( $sqls, $all ) { |
817 | 832 | $glue = ' UNION ALL '; |
818 | 833 | return 'SELECT * ' . ( $all ? '':'/* UNION_UNIQUE */ ' ) . 'FROM (' . implode( $glue, $sqls ) . ')' ; |