aboutsummaryrefslogtreecommitdiff
path: root/odb/oracle/statement.cxx
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-11-18 12:57:49 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-11-18 12:57:49 +0200
commit2927d7e0ee0e2e1714d21f46cd41279307428efa (patch)
treeafbb7d2fb12199244eca18d476e4526873991240 /odb/oracle/statement.cxx
parentb06288c055d47a6bc40783b9df5e304d0e861b87 (diff)
Check whether LOBs have been encountered before setting OCI_ATTR_MAXDATA_SIZE
Diffstat (limited to 'odb/oracle/statement.cxx')
-rw-r--r--odb/oracle/statement.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/odb/oracle/statement.cxx b/odb/oracle/statement.cxx
index 6ca3af7..0bc4014 100644
--- a/odb/oracle/statement.cxx
+++ b/odb/oracle/statement.cxx
@@ -302,6 +302,7 @@ namespace odb
udata_ = new unbind[un];
}
+ bool seen_lob (false);
sword r;
OCIError* err (conn_.error_handle ());
OCIEnv* env (conn_.database ().environment ());
@@ -505,6 +506,8 @@ namespace odb
case bind::clob:
case bind::nclob:
{
+ seen_lob = true;
+
lob* l (static_cast<lob*> (b->buffer));
if (l->buffer == 0)
@@ -588,7 +591,7 @@ namespace odb
translate_error (err, r);
}
- if (b->type == bind::string || b->type == bind::nstring)
+ if (seen_lob && (b->type == bind::string || b->type == bind::nstring))
{
// Set the maximum data size for all string types. If this is not set
// Oracle server will implicitly calculate this maximum size. If the
@@ -600,7 +603,7 @@ namespace odb
r = OCIAttrSet (h,
OCI_HTYPE_BIND,
&n,
- 9,
+ 0,
OCI_ATTR_MAXDATA_SIZE,
err);