From a84a696a3812446a33761cc0b1669d0f5bbf9335 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 7 Feb 2019 19:35:18 +0000 Subject: Update to new libdbpp interface --- libmysqlpp/my-command.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'libmysqlpp/my-command.cpp') diff --git a/libmysqlpp/my-command.cpp b/libmysqlpp/my-command.cpp index defb8a7..4ad00fc 100644 --- a/libmysqlpp/my-command.cpp +++ b/libmysqlpp/my-command.cpp @@ -115,11 +115,17 @@ MySQL::Command::bindParamF(unsigned int n, float v) } void MySQL::Command::bindParamS(unsigned int n, const Glib::ustring & s) +{ + bindParamS(n, std::string_view { s.data(), s.bytes() }); +} + +void +MySQL::Command::bindParamS(unsigned int n, const std::string_view & s) { binds[n].buffer_type = MYSQL_TYPE_STRING; - binds[n].buffer = realloc(binds[n].buffer, s.bytes()); - s.copy(static_cast(binds[n].buffer), s.bytes()); - binds[n].buffer_length = s.bytes(); + binds[n].buffer = realloc(binds[n].buffer, s.length()); + s.copy(static_cast(binds[n].buffer), s.length(), 0); + binds[n].buffer_length = s.length(); binds[n].is_unsigned = 0; } void -- cgit v1.2.3