mirror of
https://github.com/rbock/sqlpp11.git
synced 2026-01-01 10:41:22 -06:00
Fixed memory bug in handling text results in prepared statements.
This commit is contained in:
@@ -40,11 +40,12 @@ namespace sqlpp
|
||||
struct result_field_t<Db, field_spec_t<NameType, text, CanBeNull, NullIsTrivialValue>>
|
||||
: public result_field_base<Db, field_spec_t<NameType, text, CanBeNull, NullIsTrivialValue>>
|
||||
{
|
||||
const char* text{nullptr}; // Non-owning
|
||||
size_t len{};
|
||||
|
||||
template <typename Target>
|
||||
void _bind(Target& target, size_t index)
|
||||
{
|
||||
const char* text{nullptr};
|
||||
size_t len{};
|
||||
target._bind_text_result(index, &text, &len);
|
||||
if (text)
|
||||
this->_value.assign(text, len);
|
||||
@@ -56,8 +57,6 @@ namespace sqlpp
|
||||
template <typename Target>
|
||||
void _post_bind(Target& target, size_t index)
|
||||
{
|
||||
const char* text{nullptr};
|
||||
size_t len{};
|
||||
target._post_bind_text_result(index, &text, &len);
|
||||
if (text)
|
||||
this->_value.assign(text, len);
|
||||
|
||||
Reference in New Issue
Block a user