]> git.pld-linux.org Git - packages/php.git/blame - php-5.3.6-39199.patch
- make it possible to coinstall phpXY-pdo-pgsql
[packages/php.git] / php-5.3.6-39199.patch
CommitLineData
fb98beff
ER
1--- PHP_5_3/ext/pdo_oci/oci_statement.c 2010/12/10 00:30:23 306148
2+++ PHP_5_3/ext/pdo_oci/oci_statement.c 2010/12/10 00:33:48 306149
3@@ -31,6 +31,8 @@
4 #include "php_pdo_oci_int.h"
5 #include "Zend/zend_extensions.h"
6
7+#define PDO_OCI_LOBMAXSIZE (4294967295UL) /* OCI_LOBMAXSIZE */
8+
9 #define STMT_CALL(name, params) \
10 do { \
11 S->last_err = name params; \
12@@ -634,11 +636,14 @@
13 &amt, self->offset, buf, count,
14 NULL, NULL, 0, SQLCS_IMPLICIT);
15
16- if (r != OCI_SUCCESS) {
17+ if (r != OCI_SUCCESS && r != OCI_NEED_DATA) {
18 return (size_t)-1;
19 }
20
21 self->offset += amt;
22+ if (amt < count) {
23+ stream->eof = 1;
24+ }
25 return amt;
26 }
27
28@@ -664,14 +669,17 @@
29 return 0;
30 }
31
32-/* TODO: implement
33 static int oci_blob_seek(php_stream *stream, off_t offset, int whence, off_t *newoffset TSRMLS_DC)
34 {
35 struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract;
36
37- return -1;
38+ if (offset >= PDO_OCI_LOBMAXSIZE) {
39+ return -1;
40+ } else {
41+ self->offset = offset + 1; /* Oracle LOBS are 1-based, but PHP is 0-based */
42+ return 0;
43+ }
44 }
45-*/
46
47 static php_stream_ops oci_blob_stream_ops = {
48 oci_blob_write,
49@@ -679,7 +687,7 @@
50 oci_blob_close,
51 oci_blob_flush,
52 "pdo_oci blob stream",
53- NULL, /*oci_blob_seek,*/
54+ oci_blob_seek,
55 NULL,
56 NULL,
57 NULL
This page took 0.057044 seconds and 4 git commands to generate.