From: Marcin Siodelski Date: Fri, 16 Nov 2018 10:58:35 +0000 (+0100) Subject: [#53,!125] Use MYSQL_TYPE_STRING instead of MYSQL_TYPE_VARCHAR. X-Git-Tag: 177-serialize-netconf-tests_base~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc906c3aa8b6db9c32ea7d27bc3e3801c75bc361;p=thirdparty%2Fkea.git [#53,!125] Use MYSQL_TYPE_STRING instead of MYSQL_TYPE_VARCHAR. The latter causes 'buffer type not supported' errors on OpenSUSE and perhaps some other systems running MariaDB. --- diff --git a/src/lib/dhcpsrv/mysql_lease_mgr.cc b/src/lib/dhcpsrv/mysql_lease_mgr.cc index d39458d9b7..22693c8284 100644 --- a/src/lib/dhcpsrv/mysql_lease_mgr.cc +++ b/src/lib/dhcpsrv/mysql_lease_mgr.cc @@ -546,7 +546,10 @@ public: // reasons, see memset() above // hostname: varchar(255) - bind_[8].buffer_type = MYSQL_TYPE_VARCHAR; + // Note that previously we used MYSQL_TYPE_VARCHAR instead of + // MYSQL_TYPE_STRING. However, that caused 'buffer type not supported' + // errors on some systems running MariaDB. + bind_[8].buffer_type = MYSQL_TYPE_STRING; bind_[8].buffer = const_cast(lease_->hostname_.c_str()); bind_[8].buffer_length = lease_->hostname_.length(); // bind_[8].is_null = &MLM_FALSE; // commented out for performance @@ -667,6 +670,9 @@ public: // reasons, see memset() above // hostname: varchar(255) + // Note that previously we used MYSQL_TYPE_VARCHAR instead of + // MYSQL_TYPE_STRING. However, that caused 'buffer type not supported' + // errors on some systems running MariaDB. hostname_length_ = sizeof(hostname_buffer_); bind_[8].buffer_type = MYSQL_TYPE_STRING; bind_[8].buffer = reinterpret_cast(hostname_buffer_); @@ -1006,7 +1012,7 @@ public: // reasons, see memset() above // hostname: varchar(255) - bind_[11].buffer_type = MYSQL_TYPE_VARCHAR; + bind_[11].buffer_type = MYSQL_TYPE_STRING; bind_[11].buffer = const_cast(lease_->hostname_.c_str()); bind_[11].buffer_length = lease_->hostname_.length(); // bind_[11].is_null = &MLM_FALSE; // commented out for performance