Oracle: Oci8 patch to support BLOBS/CLOBS in 64-bit platforms (thanks wqcmaster)

git-svn-id: svn://ultimatepp.org/upp/trunk@6906 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-02-10 19:09:19 +00:00
parent d92fe859d3
commit a8d842fe6e

View file

@ -818,6 +818,23 @@ void OCI8Connection::GetColumn(int i, String& s) const {
}
const Item& c = column[i];
if(c.type == SQLT_BLOB || c.type == SQLT_CLOB) {
if (sizeof(int) < sizeof(uintptr_t)){ // CPU_64
int64 handle;
GetColumn(i, handle);
if(!IsNull(handle)) {
if(c.type == SQLT_CLOB && session->utf8_session) {
OracleClob clob(*session, handle);
s = FromUnicode(clob.Read());
}
else {
OracleBlob blob(*session, handle);
s = LoadStream(blob);
}
}
else
s = Null;
return;
}
int handle;
GetColumn(i, handle);
if(!IsNull(handle)) {
@ -851,6 +868,24 @@ void OCI8Connection::GetColumn(int i, WString& ws) const {
}
const Item& c = column[i];
if(c.type == SQLT_BLOB || c.type == SQLT_CLOB) {
if (sizeof(int) < sizeof(uintptr_t)){ // CPU_64
int64 handle;
GetColumn(i, handle);
if(!IsNull(handle)) {
if(session->utf8_session && c.type == SQLT_CLOB) {
OracleClob clob(*session, handle);
ws = clob.Read();
}
else {
OracleBlob blob(*session, handle);
String s = LoadStream(blob);
ws = s.ToWString();
}
}
else
ws = Null;
return;
}
int handle;
GetColumn(i, handle);
if(!IsNull(handle)) {