Skip to content

Commit

Permalink
Changes submitted by Phillipe Le Rohellec <phillipe@cloudmark.com>
Browse files Browse the repository at this point in the history
       In the function that converts LOBs to string, ocilob_sqllvc,
       the length of the field is first retrieved by a call to
       OCILobGetLength which is good, but right after that the amtp
       variable is set to that size minus the offset and the offset is 1.

       amtp tells the OCILobRead function how much data it needs to
       read and amtp is off by 1 which explain my truncated reads.

       The fix is to change
       amtp=ir->lobsiz-ir->posn;
       to
       amtp=ir->lobsiz-ir->posn+1;
  • Loading branch information
dbox-fnal committed Mar 17, 2005
1 parent 42544c6 commit 650e9a1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/oracle_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
*******************************************************************************
*
* $Id: oracle_functions.c,v 1.34 2005/02/21 19:43:53 dbox Exp $
* $Id: oracle_functions.c,v 1.35 2005/03/17 01:36:32 dbox Exp $
* NOTE
* There is no mutexing in these functions, it is assumed that the mutexing
* will be done at a higher level
Expand All @@ -35,7 +35,7 @@
#include "ocitrace.h"
#include <sqlext.h>

static char const rcsid[]= "$RCSfile: oracle_functions.c,v $ $Revision: 1.34 $";
static char const rcsid[]= "$RCSfile: oracle_functions.c,v $ $Revision: 1.35 $";

/*
* There is a problem with a lot of libclntsh.so releases... an undefined
Expand Down Expand Up @@ -2510,7 +2510,7 @@ SQLRETURN ocilob_sqllvc(int row,ir_T* ir ,SQLPOINTER target,
OCILobGetLength(ir->desc->stmt->dbc->oci_svc,ir->desc->stmt->dbc->oci_err,
ir->locator[row],&ir->lobsiz);

amtp=ir->lobsiz-ir->posn;
amtp=ir->lobsiz-ir->posn+1;
if(amtp>(unsigned)buflen)
amtp=(unsigned)buflen;

Expand Down

0 comments on commit 650e9a1

Please sign in to comment.