From edb5c55e828ad333ce1059b60b6fe97eface5dc4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 12 Jan 2012 09:02:40 +0200 Subject: Implement callback data re-basing support for LOB result streaming This is used by the query machinery when a copy of the image has to be made. In this case stream_result() needs to use data from the copy of the image, and not from the image that was bound to the bind array. --- odb/oracle/statement.hxx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'odb/oracle/statement.hxx') diff --git a/odb/oracle/statement.hxx b/odb/oracle/statement.hxx index fa2e879..6aa16e9 100644 --- a/odb/oracle/statement.hxx +++ b/odb/oracle/statement.hxx @@ -84,9 +84,18 @@ namespace odb std::size_t lob_prefetch_size = 0); // Stream the result LOBs, calling user callbacks where necessary. + // The old_base and new_base arguments can be used to "re-base" the + // lob_callback struct pointer (stored in bind::callback), the lob + // struct pointer (stored in bind::buffer), and the indicator value + // pointer (stored in bind::indicator). This is used by the query + // machinery to cause stream_result() to use the callback information + // from a copy of the image instead of the bound image. // void - stream_result (bind*, std::size_t count); + stream_result (bind*, + std::size_t count, + void* old_base = 0, + void* new_base = 0); protected: connection& conn_; @@ -162,9 +171,12 @@ namespace odb fetch (); void - stream_result () + stream_result (void* old_base = 0, void* new_base = 0) { - statement::stream_result (result_.bind, result_.count); + statement::stream_result (result_.bind, + result_.count, + old_base, + new_base); } void -- cgit v1.1