0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00

More defensive string construction in result set.

This commit is contained in:
rbock 2017-03-06 09:14:51 +01:00
parent f88efada67
commit 9145a3a4ee

View File

@ -46,7 +46,10 @@ namespace sqlpp
const char* text{nullptr};
size_t len{};
target._bind_text_result(index, &text, &len);
if (text)
this->_value = {text, len};
else
this->value = {};
this->_is_null = (text == nullptr);
}
@ -56,7 +59,10 @@ namespace sqlpp
const char* text{nullptr};
size_t len{};
target._post_bind_text_result(index, &text, &len);
if (text)
this->_value = {text, len};
else
this->value = {};
this->_is_null = (text == nullptr);
}
};