.Oracle/Oci8.cpp: added zero-length check to OracleClob

git-svn-id: svn://ultimatepp.org/upp/trunk@4101 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
rylek 2011-10-24 21:31:04 +00:00
parent 1cd8f2c8e4
commit bfb017762e

View file

@ -1490,6 +1490,8 @@ dword OracleBlob::Read(int64 at, void *ptr, dword size) {
void OracleBlob::Write(int64 at, const void *ptr, dword size) {
ASSERT(IsOpen() && (style & STRM_WRITE) && session);
ASSERT(at == (dword)at);
if(!size)
return;
ub4 n = size;
int res = session->oci8.OCILobWrite(session->svchp, session->errhp, locp, &n, (dword)at + 1, (void *)ptr, size,
OCI_ONE_PIECE, NULL, NULL, 0, SQLCS_IMPLICIT);
@ -1596,6 +1598,8 @@ dword OracleClob::Read(int64 at, void *ptr, dword size) {
void OracleClob::Write(int64 at, const void *ptr, dword size) {
ASSERT(IsOpen() && (style & STRM_WRITE) && session);
ASSERT(at == (dword)at);
if(!size)
return;
bool utf8 = session->IsUtf8Session();
if(at & 1) {
char auxbuf[2];