Author: byterock
Date: Fri Jul 10 12:55:13 2009
New Revision: 13037

Modified:
   dbd-oracle/branches/rs_array/oci8.c

Log:
working copy

Modified: dbd-oracle/branches/rs_array/oci8.c
==============================================================================
--- dbd-oracle/branches/rs_array/oci8.c (original)
+++ dbd-oracle/branches/rs_array/oci8.c Fri Jul 10 12:55:13 2009
@@ -2720,20 +2720,26 @@
                ++num_errors;
        }
 
-    imp_sth->rs_array_size=cache_rows;
+    if (imp_sth->ret_lobs){
+               imp_sth->rs_array_size=1;
+       }
+       else {
+           imp_sth->rs_array_size=cache_rows;
     /*set the size of the array buffer*/
-
+       }
     if (max_cache_rows){/* limited by a cursor or something else*/
                imp_sth->rs_array_size=max_cache_rows;
        }
 
 
-       if (imp_sth->row_cache_off){/*set the size of the Rows in Cache value*/
+/*     if (imp_sth->row_cache_off){/*set the size of the Rows in Cache value
                imp_dbh->RowsInCache =1;
        }
-       else {
+        else {
                imp_dbh->RowsInCache=imp_sth->rs_array_size;
        }
+*/
+
 
        if (DBIS->debug >= 3 || dbd_verbose >= 3 || oci_warn) /*will also 
display if oci_want is on*/
                PerlIO_printf(DBILOGFP,
@@ -3002,9 +3008,10 @@
        D_imp_drh_from_dbh;
        UV      long_readlen;
        ub4 num_fields;
-       int num_errors = 0;
-       int has_longs = 0;
-       int est_width = 0;              /* estimated avg row width (for cache)  
*/
+       int num_errors  = 0;
+       int has_longs   = 0;
+       int has_lobs    = 0;
+       int est_width   = 0;            /* estimated avg row width (for cache)  
*/
        int nested_cursors = 0;
        ub4 i = 0;
        sword status;
@@ -3488,7 +3495,7 @@
        if (DBIS->debug >= 3 || dbd_verbose >= 3 )
                PerlIO_printf(DBILOGFP,
                        "       dbd_describe'd %d columns (row bytes: %d max, 
%d est avg, cache: %d)\n",
-                       (int)num_fields, imp_sth->t_dbsize, imp_sth->est_width, 
imp_sth->cache_rows);
+                       (int)num_fields, imp_sth->t_dbsize, imp_sth->est_width, 
imp_sth->prefetch_rows);
 
        return (num_errors>0) ? 0 : 1;
 }
@@ -3550,7 +3557,7 @@
                }
                else {
 
-                       if (imp_sth->row_cache_off){ /*Do not use array fetch 
or local cache */
+                       if (!imp_sth->row_cache_off){ /*Do not use array fetch 
or local cache */
                                OCIStmtFetch_log_stat(imp_sth->stmhp, 
imp_sth->errhp,1,(ub2)OCI_FETCH_NEXT, OCI_DEFAULT, status);
                                imp_sth->rs_fetch_count++;
                                imp_sth->rs_array_idx=0;
@@ -3558,11 +3565,14 @@
                        }
                        else {  /*Array Fetch the New Noraml Super speedy and 
very nice*/
 
-                               imp_dbh->RowsInCache--;
+/*                     PerlIO_printf(DBILOGFP, "       dbd_st_fetch 
fields...a\n");*/
+                               imp_dbh->RowsInCache--;
                                imp_sth->rs_array_idx++;
-/*                                     PerlIO_printf(DBILOGFP," /n/n 
rs_array_num_rows=%d,imp_sth->rs_array_idx=%d\n",imp_sth->rs_array_idx,imp_sth->rs_array_num_rows);*/
+                                       PerlIO_printf(DBILOGFP," \n 
imp_sth->rs_array_idx=%d,rs_array_num_rows=%d\n",imp_sth->rs_array_idx,imp_sth->rs_array_num_rows);
+
+                               if 
(imp_sth->rs_array_num_rows<=imp_sth->rs_array_idx && 
(imp_sth->rs_array_status==OCI_SUCCESS || 
imp_sth->rs_array_status==OCI_SUCCESS_WITH_INFO)) {                  
PerlIO_printf(DBILOGFP, "       dbd_st_fetch %d fields...a\n");
+                       PerlIO_printf(DBILOGFP, "       dbd_st_fetch 
fields...b\n");
 
-                               if 
(imp_sth->rs_array_num_rows<=imp_sth->rs_array_idx && 
(imp_sth->rs_array_status==OCI_SUCCESS || 
imp_sth->rs_array_status==OCI_SUCCESS_WITH_INFO)) {
                                        
OCIStmtFetch_log_stat(imp_sth->stmhp,imp_sth->errhp,imp_sth->rs_array_size,(ub2)OCI_FETCH_NEXT,OCI_DEFAULT,status);
                                        imp_sth->rs_array_status=status;
                                        imp_sth->rs_fetch_count++;

Reply via email to