@@ -79,13 +79,12 @@ using namespace dpi;
79
79
80
80
void Lob::read (DpiHandle *svch, DpiHandle *errh, Descriptor *lobLocator,
81
81
unsigned long long &byteAmount, unsigned long long &charAmount,
82
- unsigned long long offset, void *buf)
82
+ unsigned long long offset, void *buf, unsigned long long bufl )
83
83
{
84
84
ociCall (OCILobRead2 ((OCISvcCtx *)svch, (OCIError *)errh,
85
85
(OCILobLocator *)lobLocator,
86
86
(oraub8 *)&byteAmount, (oraub8 *)&charAmount,
87
- // for CLOBs, buflen is sized to handle multi-byte charsets
88
- offset, buf, byteAmount ? byteAmount : charAmount*4 ,
87
+ offset, buf, (oraub8)(byteAmount ? byteAmount : bufl),
89
88
OCI_ONE_PIECE, NULL , NULL , 0 , SQLCS_IMPLICIT),
90
89
(OCIError *)errh);
91
90
}
@@ -127,13 +126,12 @@ void Lob::read(DpiHandle *svch, DpiHandle *errh, Descriptor *lobLocator,
127
126
128
127
void Lob::write (DpiHandle *svch, DpiHandle *errh, Descriptor *lobLocator,
129
128
unsigned long long &byteAmount, unsigned long long &charAmount,
130
- unsigned long long offset, void *buf)
129
+ unsigned long long offset, void *buf, unsigned long long bufl )
131
130
{
132
131
ociCall (OCILobWrite2 ((OCISvcCtx *)svch, (OCIError *)errh,
133
132
(OCILobLocator *)lobLocator,
134
133
(oraub8 *)&byteAmount, (oraub8 *)&charAmount,
135
- // for CLOBs, buflen is sized to handle multi-byte charsets
136
- offset, buf, byteAmount ? byteAmount : charAmount*4 ,
134
+ offset, buf, (oraub8)(byteAmount ? byteAmount : bufl),
137
135
OCI_ONE_PIECE, NULL , NULL , 0 , SQLCS_IMPLICIT),
138
136
(OCIError *)errh);
139
137
}
0 commit comments