Re: cvs: pear /MDB2/MDB2/Driver oci8.php
| From: | Justin Patrin | Date: | Tue, 26 Sep 2006 15:37:18 +0000 |
| Subject: | Re: cvs: pear /MDB2/MDB2/Driver oci8.php | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-44063@lists.php.net to get a copy of this message | ||
On 9/26/06, Lukas Kahwe Smith <mls@pooteeweet.org> wrote:
Justin Patrin wrote:Do you mean convertResultRow()? This would mean that the call would have to be moved into _fillBuffer() (it is currently in fetchRow(), so this would mean a higher _fillBuffer() overhead and possibly converting rows which are not used, a-la seek) and would have to be called even if there are no types passed in (yes, I know, I should be passing in types, but it would be no good to have this fix only affect people who pass in types). And, of course, convertResultRow() already does a foreach....I really don't see how we could loop through the resulting fields without....looping through the resulting fields. Something a bit better might be to pre-loop through the fields (tableInfo) and check for LOB fields, storing these in an array, then only loop through these fields for load()-ing. This should be somewhat of a speedup for large result sets. Or am I missing your point entirely? ;-) -- Justin Patrinjustinpatrin Mon Sep 25 23:30:04 2006 UTCModified files:/pear/MDB2/MDB2/Driver oci8.phpLog: For a buffered result set we need to load the LOBs as we fetch them @@ -1143,6 +1143,11 @@if ($this->offset > 0) { array_pop($buffer); } + foreach (array_keys($buffer) as $key) { + if (is_a($buffer[$key], 'oci-lob')) { + $buffer[$key] = $buffer[$key]->load(); + } + } $this->buffer[$this->buffer_rownum] = $buffer; }I have thought about this issue a bit. I think we should probably have a parameter in the convertResult() method that automatically calls load() on all LOBs so that we do not need this expensive foreach() loop. I will try to implement something in the next 1-2 days, but I just wanted to throw this idea out there for people to comment.