SOCI/soci — pull request #146 by ricardofandrade (2013-04-28 03:58:46+00:00)
Title: Fixes memory corruption with use(std::string) with variations in string length.

DB2 backend seems to follow the implementation ODBC one, so this fix is almost a copy of odbc_standard_use_type_backend.
db2_standard_use_type_backend calculates the size of variables during bind() while ODBC does it during pre_use().

If the value (strings specifically) has its size changed between bind (statement::prepare) and pre_use (statement::execute) the backend will have the previous size.
This difference results in wrongly sized buffers what may lead to memory corruption.

test_prepared_insert_with_orm_type crashes without this fix.