summaryrefslogtreecommitdiff
path: root/libmysqlpp/my-command.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2019-02-07 19:35:18 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2019-02-07 19:35:18 +0000
commita84a696a3812446a33761cc0b1669d0f5bbf9335 (patch)
tree7c5d5cc5119a2cb36b478cf0da971b449bd79df0 /libmysqlpp/my-command.cpp
parentFix test of insertIds (diff)
downloadlibdbpp-mysql-a84a696a3812446a33761cc0b1669d0f5bbf9335.tar.bz2
libdbpp-mysql-a84a696a3812446a33761cc0b1669d0f5bbf9335.tar.xz
libdbpp-mysql-a84a696a3812446a33761cc0b1669d0f5bbf9335.zip
Update to new libdbpp interfacelibdbpp-mysql-1.4.0
Diffstat (limited to 'libmysqlpp/my-command.cpp')
-rw-r--r--libmysqlpp/my-command.cpp12
1 files changed, 9 insertions, 3 deletions
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
@@ -116,10 +116,16 @@ 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<char*>(binds[n].buffer), s.bytes());
- binds[n].buffer_length = s.bytes();
+ binds[n].buffer = realloc(binds[n].buffer, s.length());
+ s.copy(static_cast<char*>(binds[n].buffer), s.length(), 0);
+ binds[n].buffer_length = s.length();
binds[n].is_unsigned = 0;
}
void