mirror of
https://github.com/pocoproject/poco.git
synced 2025-03-04 07:27:23 +01:00
fix(MySQL): MySQL UUID binding temporary string #3587
This commit is contained in:
parent
132f4f4767
commit
02dcc550b4
@ -213,8 +213,7 @@ void Binder::bind(std::size_t pos, const Time& val, Direction dir)
|
||||
|
||||
void Binder::bind(std::size_t pos, const UUID& val, Direction dir)
|
||||
{
|
||||
std::string str = val.toString();
|
||||
bind(pos, str, dir);
|
||||
bind(pos, toString(val), dir);
|
||||
}
|
||||
|
||||
|
||||
|
@ -356,6 +356,13 @@ public:
|
||||
|
||||
static bool isInBound(Direction dir);
|
||||
/// Returns true if direction is in bound;
|
||||
|
||||
protected:
|
||||
const std::string& toString(const UUID& uuid);
|
||||
|
||||
private:
|
||||
using StringList = std::vector<std::string*>;
|
||||
std::unique_ptr<StringList> _pStrings;
|
||||
};
|
||||
|
||||
|
||||
|
@ -33,6 +33,19 @@ AbstractBinder::AbstractBinder()
|
||||
|
||||
AbstractBinder::~AbstractBinder()
|
||||
{
|
||||
if (_pStrings)
|
||||
{
|
||||
for (auto& s : *_pStrings)
|
||||
delete s;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const std::string& AbstractBinder::toString(const UUID& uuid)
|
||||
{
|
||||
if (!_pStrings) _pStrings.reset(new StringList);
|
||||
_pStrings->push_back(new std::string(uuid.toString()));
|
||||
return *_pStrings->back();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user