From c94ffe778485970621a709ccf1312568ddaf7943 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Tue, 15 Nov 2011 16:34:47 +0200 Subject: Refactor LOB descriptor, callback context, and temporary buffer handling Due to image sharing amongst container statements, LOB binding placeholders cannot be shared between parameter and result versions of a bind. --- odb/relational/oracle/header.cxx | 2 +- odb/relational/oracle/source.cxx | 18 +++--------------- 2 files changed, 4 insertions(+), 16 deletions(-) (limited to 'odb') diff --git a/odb/relational/oracle/header.cxx b/odb/relational/oracle/header.cxx index 5d13d41..17c1103 100644 --- a/odb/relational/oracle/header.cxx +++ b/odb/relational/oracle/header.cxx @@ -214,7 +214,7 @@ namespace relational { os << "mutable " << image_type << " " << mi.var << "callback;" << "sb2 " << mi.var << "indicator;" - << "oracle::lob_auto_descriptor " << mi.var << "lob;" + << "oracle::lob " << mi.var << "lob;" << "mutable oracle::lob_context " << mi.var << "context;" << "ub4 " << mi.var << "position_context;" << endl; diff --git a/odb/relational/oracle/source.cxx b/odb/relational/oracle/source.cxx index 0d4fee0..5c66154 100644 --- a/odb/relational/oracle/source.cxx +++ b/odb/relational/oracle/source.cxx @@ -265,8 +265,6 @@ namespace relational { os << b << ".type = oracle::bind::timestamp;" << b << ".buffer = &" << arg << "." << mi.var << "value;" - << b << ".capacity = sizeof (OCIDateTime*);" - << b << ".size = 0;" << b << ".indicator = &" << arg << "." << mi.var << "indicator;"; } @@ -275,8 +273,6 @@ namespace relational { os << b << ".type = oracle::bind::interval_ym;" << b << ".buffer = &" << arg << "." << mi.var << "value;" - << b << ".capacity = sizeof (OCIInterval*);" - << b << ".size = 0;" << b << ".indicator = &" << arg << "." << mi.var << "indicator;"; } @@ -285,8 +281,6 @@ namespace relational { os << b << ".type = oracle::bind::interval_ds;" << b << ".buffer = &" << arg << "." << mi.var << "value;" - << b << ".capacity = sizeof (OCIInterval*);" - << b << ".size = 0;" << b << ".indicator = &" << arg << "." << mi.var << "indicator;"; } @@ -307,19 +301,13 @@ namespace relational { os << b << ".type = " << lob_buffer_types[mi.st->type - sql_type::BLOB] << ";" + << arg << "." << mi.var << "lob.position_context = &" << arg << + "." << mi.var << "position_context;" + << b << ".buffer = &" << arg << "." << mi.var << "lob;" << b << ".indicator = &" << arg << "." << mi.var << "indicator;" << b << ".callback = &" << arg << "." << mi.var << "callback;" << b << ".context = &" << arg << "." << mi.var << "context;" - << "if (sk == statement_select)" << endl - << "{" - << b << ".buffer = &" << arg << "." << mi.var << "lob;" - << b << ".capacity = sizeof (OCILobLocator*);" - << b << ".size = 0;" - << "}" - << "else" << endl - << b << ".size = reinterpret_cast (&" << arg << "." << - mi.var << "position_context);" << endl; } -- cgit v1.1