vrogier / ocilib

OCILIB (C and C++ Drivers for Oracle) - Open source C and C++ library for accessing Oracle databases
http://www.ocilib.net
Apache License 2.0
325 stars 119 forks source link

C++ Value types perform handle assignment instead of value assignment #351

Open vrogier opened 1 year ago

vrogier commented 1 year ago

OCILIB C++ value types (Date, Number, Interval and Timestamp) uses the default HandlerHolder parent class assignment implementation that is performing a C handle assignment, thus changing the internal handle value. These handle assignment were meant to avoid creating different handles and doing value assignment between them. This behavior causes a issue when these host variables are bound to a statement as single value, their handles are passed to Oracle client. Reassigning them between execution iterations, leads Oracle to fill previous handles (that might be dangling pointers).